Button Methods

Click

Clicks on the button. Verifies the click was successful with the specified verification and performs retries if necessary.

Syntax:

public void Click(
	Func<bool> verification
)

Parameters:

Parameter

Description

verification

Exceptions:

Exception

Condition

When the button could not be found on the screen.

When the Click could not be verified successfully after the configured amount of retries of the click.

ClickWithUpdateCheck

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.

Syntax:

public void ClickWithUpdateCheck(
        ImgDiffTolerance tolerance, 
        double timeoutInSec = 0, 
        params IImageFilter[] filters
)

Parameters:

Parameter

Description

tolerance

timeoutInSec

filters

Exceptions:

Exception

Condition

When the button could not be found on the screen.

When the Click could not be verified successfully after the configured amount of retries of the click.

DoubleClick

Performs a double click on the button. Wait time between the individual clicks is controlled by the optional parameter doubleClickDelay.

See also: TesterMouseExtensions.DoubleClick

Syntax:

public void DoubleClick(
	Func<bool> verification,
	int doubleClickDelay = 50	
)

Parameters:

Parameter

Description

verification

[doubleClickDelay]

Exceptions:

Exception

Condition

When the button could not be found on the screen.

When the DoubleClick could not be verified successfully after the configured amount of retries of the click.

Hover

Moves the mouse over the button. Verifies the hover was successful with the specified verification and performs retries if necessary.

Syntax:

public void Hover(
	Func<bool> verification
)

Parameters:

Parameter

Description

verification

Exceptions:

Exception

Condition

When the button could not be found on the screen.

When the Hover could not be verified successfully after the configured amount of retries.

IsActive

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.

Syntax:

public bool IsActive()

Return Value:

True, if the active representation of the button is found; false, if the inactive representation is found.

Exceptions:

Exception

Condition

When the button could not be found on the screen.

The found representation was not named "active" or "inactive"

WaitForActive

Overload List

Name

Description

Waits for the active status. Returns false if the status is not reached after the given waitTime

WaitForActive()

Waits for the active status. Returns false if the status is not reached after OnScreenElement.WaitTimeInSeconds.

Syntax:

public bool WaitForActive()

Return Value:

True, if the active state was reached after OnScreenElement.WaitTimeInSeconds, false otherwise.

Exceptions:

Exception

Condition

When the button could not be found on the screen.

The found representation was not named "active" or "inactive"

WaitForActive(TimeSpan)

Waits for the active status. Returns false if the status is not reached after the given waitTime.

Syntax:

public bool WaitForActive(
        TimeSpan waitTime
)

Parameters:

Parameter

Description

waitTime

Return Value:

True, if the active state was reached after waitTime, false otherwise.

Exceptions:

Exception

Condition

When the button could not be found on the screen.

The found representation was not named "active" or "inactive"

WaitForInactive

Overload List

Name

Description

Waits for the inactive status. Returns false if the status is not reached after waitTime

WaitForInactive()

Waits for the inactive status. Returns false if the status is not reached after OnScreenElement.WaitTimeInSeconds.

Syntax:

public bool WaitForInactive()

Return Value:

True, if the inactive state was reached after OnScreenElement.WaitTimeInSeconds, false otherwise.

Exceptions:

Exception

Condition

When the button could not be found on the screen.

The found representation was not named "active" or "inactive"

WaitForInactive(TimeSpan)

Waits for the inactive status. Returns false if the status is not reached after waitTime.

Syntax:

public bool WaitForInactive(
        TimeSpan waitTime
)

Parameters:

Parameter

Description

waitTime

Return Value:

True, if the inactive state was reached after waitTime, false otherwise.

Exceptions:

Exception

Condition

When the button could not be found on the screen.

The found representation was not named "active" or "inactive"

Last updated