Page 1 of 1

How to Synchronize a step

Posted: Thu Nov 05, 2015 1:14 pm
by upendra
Hi,
I have an record and play back test case and while executing the test case , i am facing the time interval issue.

e.g For a particular step ,sometimes it is taking 500 ms and sometimes it is taking 2000 ms depending on the test data used .
So i want to set the time limit so that it will take the required time and rest will be elapsed.
i.e if i set the time limit 5000 ms and the steps required 2000 ms during execution so it will take only 2000 ms and rest will be elapsed so that tool doesn't have to wait till end.

I have tried with Waitfor option, but it is not working as expected.
Thanks in Advance!.

Regards
Upendra

Re: How to Synchronize a step

Posted: Thu Nov 05, 2015 1:33 pm
by odklizec
Hi Upendra,

What exactly you found not working about Waitfor option? Because WaitFor Exists/NotExists seems to be exactly what you are looking for ;)

Re: How to Synchronize a step

Posted: Thu Nov 05, 2015 1:33 pm
by Martin
Hey

Don't actually use specified timeouts in these situations if you have no control over the actual time taken.

In this case it's a good idea to use WaitForExists:

Code: Select all

repo.Dom.objectNameInfo.WaitForExists(30000);
This will wait for the object to exists and if it happens in less time than specified 30 seconds, it will continue with the next step.