TesterOnScreenElementExtensions

WaitForMultipleElements

Waits simultaneously for a list of OnScreenElements and returns the first element that was found. This can be useful when an action has multiple possible outcomes and depending on the shown element (e.g. warning dialog) a different action needs to be taken.

As search duration the maximum WaitTimeInSeconds of all elements is used.

Example for usage:

var foundDialog = t.WaitForMultipleElements(NewTestCaseDialog, authenticationRequiredDialog);
if (foundDialog == NewTestCaseDialog)
    return;
else if (foundDialog == authenticationRequiredDialog)
{
    authenticationRequiredDialog.Authenticate(user, pw);
    NewTestCaseDialog.WaitFor();
}

Syntax:

public static OnScreenElement WaitForMultipleElements(
    this ITester t,
    params OnScreenElement[] elements
)

Parameters:

Parameter

Description

t

Type: ITester The ITester interface on which the extension is called.

elements

Type: OnScreenElement[ ] The list of elements for which we should wait. Can be any combination of Screens, Labels, Buttons, etc.

Return Value:

The first OnScreenElement that was found on the screen (out of the elements parameter) or null if no element was found.

Last updated