Button
Last updated
Was this helpful?
Last updated
Was this helpful?
The button class represents one of the most common UI elements, anything that can be clicked to trigger an effect. Not only text buttons fall into this category, but for example icons, tool selections, links, etc.
A Button can be identified either by a text (e.g. the caption of the button) or by one or several images. Often buttons have several states that have different representation in addition to the default look, such as disabled, activated or highlighted. The button class offers to distinguish between theses states by separating the representation images in active and inactive. Then you can use the or methods to check for a certain state. There can be also several active and inactive representations of the button, in this case make sure to put the corresponding images in sub-folders and pass the corresponding ImageReferences to the Button constructor.
Namespace: Progile.TRIO.BaseModel Assembly: Progile.TRIO.BaseModel (in Progile.TRIO.BaseModel.dll)
Progile.TRIO.BaseModel.Button
Creates a new Button instance, that can be found with an image search for the activeImageReference within the provided filters. If button has active and inactive states, use the with both activeImageReference and inactiveImageReference parameters instead.
Syntax:
Parameter
Description
tester
The tester interface.
displayName
activeImageReference
useVisualSense
[filters]
Syntax:
Parameter
Description
tester
The tester interface.
displayName
activeImageReference
[inactiveImageReference]
useVisualSense
[filters]
Creates a new Button instance, that can be found with a text search for searchText within the provided filters.
Syntax:
Parameter
Description
tester
The tester interface.
displayName
serachText
useVisualSense
[filters]
Name
Description
Clicks on the button. Verifies the click was successful with the specified verification and performs retries if necessary.
Clicks on the button and uses an update check in the provided filters as verification. Should only be used if no other verify method is applicable. If after the click no update is detected in the region defined by filters, retries are performed. Note: filters should be chosen so that hover / click effects of the button itself don't trigger the update.
Performs a double click on the button. Wait time between the individual clicks is controlled by the optional parameter doubleClickDelay.
Moves the mouse over the button. Verifies the hover was successful with the specified verification and performs retries if necessary.
Checks the state of the button. Returns true if the button is active, false if the button is inactive. Requires that images named "active" and "inactive" are present in the folder given as content.
Waits for the active status. Returns false if the status is not reached after the given waitTime.
Waits for the inactive status. Returns false if the status is not reached after waitTime.
Name
Description
Default: true
Type:
Type: The name of the element that will be used for logging and reporting of exceptions (customer facing).
Type: The image reference that will be used to locate the button on the screen.
Type: True if VisualSense should be used to find the element
Type: [ ] Typically a filter indicating the area of interest for the image searches.
Creates a new Button instance, that can be found with an image search for either the active or inactive image reference within the provided filters. The active and inactive image references are used to check for the button state with , and .
Type:
Type: The name of the element that will be used for logging and reporting of exceptions (customer facing).
Type: The active image reference that will be used to locate the button on the screen.
Type: The inactive image reference of the button. Will also be used to locate the button on the screen.
Type: True if VisualSense should be used to find the element
Type: [ ] Typically a filter indicating the area of interest for the image searches.
Type:
Type: The name of the element that will be used for logging and reporting of exceptions (customer facing).
Type: The searchText that will be used to locate the button on the screen.
Type: True if VisualSense should be used to find the element
Type: [ ] Typically a filter indicating the area of interest for the image searches.
Waits for the active status. Returns false if the status is not reached after .
Waits for the inactive status. Returns false if the status is not reached after .
Configure how much the mouse should move away after clicking. Use if the Button has a Mouseover Tooltip which hides to Button, so no retry can be executed. Set a custom or use for example
Default: , so the mouse does not move away after clicking.
If true the mouse moves with a slow approach to the point before clicking, using the . If false the mouse jumps immediately to the point and clicks.