Forum Discussion
I'm not entirely sure I follow, are you saying that you are running a bunch of tests and at some point during the test a random pop-up could appear which you need to account for? What is the pop-up and how is it triggered?
Some options beyond relying on auto wait >> You can try using aqUtils.Delay and creating your own loop OR use HISUtils.StopWatch to create your own timer. See some samples below...
This example stays in the loop while a certain page element property exists OR until 45 minutes has been reached (edit times as needed):
var loopTimeout = 0;
while (Aliases.Page.FindChild("WndCaption", "Retrieving*", 3).Exists)
{
Delay(1000); // delay for 1 second
loopTimeout++;
if (loopTimeout == 2700000) // If the loop has been going for 45 minutes get out of it.
{
Log.Error("Process exceeded the allotted time to retrieve data.");
break;
}
}
This example uses the StopWatch approach and is just setting a cap on the timer (45 min) where you can do other stuff in-between:
// Time parameters
stopWatch = HISUtils.StopWatch;
limit = 2700000;// 45 minutes
// Start time limit loop
stopWatch.Start();
if(stopWatch.Split() >= limit) {
Log.Enabled == true;
Log.Warning("The process has exceeded the " + (limit/1000)/60 + " minute time limit.");
stopWatch.Stop();
break;
}
else {
// do something else
} Change the logic to best suite your needs if you need to do other things while your delay/timer is running.