Button
Description
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 IsActive or WaitForStatus 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.
Button Class
Namespace: Progile.TRIO.BaseModel Assembly: Progile.TRIO.BaseModel (in Progile.TRIO.BaseModel.dll)
Inheritance Hierarchy:
Object Progile.TRIO.BaseModel.OnScreenElement Progile.TRIO.BaseModel.Button
Constructors
Button(ITester, string, ImageReference, bool, IImageFilter[ ])
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 constructor with both activeImageReference and inactiveImageReference parameters instead.
Syntax:
Parameter
Description
tester
The tester interface.
displayName
activeImageReference
useVisualSense
[filters]
Button(ITester, string, ImageReference, ImageReference, bool, IImageFilter[ ])
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 IsActive, WaitForActive and WaitForInactive.
Syntax:
Parameter
Description
tester
The tester interface.
displayName
activeImageReference
[inactiveImageReference]
useVisualSense
[filters]
Button(ITester, string, string, bool, IImageFilter[ ])
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]
Methods
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.
Properties
Name
Description
Default: true
Last updated