TesterOnScreenElementExtensions
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.
var foundDialog = t.WaitForMultipleElements(NewTestCaseDialog, authenticationRequiredDialog);
if (foundDialog == NewTestCaseDialog)
return;
else if (foundDialog == authenticationRequiredDialog)
{
authenticationRequiredDialog.Authenticate(user, pw);
NewTestCaseDialog.WaitFor();
}
public static OnScreenElement WaitForMultipleElements(
this ITester t,
params OnScreenElement[] elements
)
Parameter | Description |
t | |
elements | Type: OnScreenElement[ ]
The list of elements for which we should wait. Can be any combination of Screens, Labels, Buttons, etc. |
The first OnScreenElement that was found on the screen (out of the elements parameter) or null if no element was found.
Last modified 2yr ago