How to Synchronize a step

Ask general questions here.
upendra
Posts: 13
Joined: Tue Oct 06, 2015 11:27 am

How to Synchronize a step

Post by upendra » Thu Nov 05, 2015 1:14 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to Synchronize a step

Post by odklizec » Thu Nov 05, 2015 1:33 pm

Hi Upendra,

What exactly you found not working about Waitfor option? Because WaitFor Exists/NotExists seems to be exactly what you are looking for ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: How to Synchronize a step

Post by Martin » Thu Nov 05, 2015 1:33 pm

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.