Forum Discussion
levi_bryant
11 years agoContributor
If you have to use a Delay I would suggest using a Wait instead. Especially in cases where you have a lot of delays. The problem with delays is that they add so much time to your running script. A wait will only wait as long as it has to. So if you put a delay of 5 seconds it will always be a 5 second wait even if the object you want is available after 1 second. A wait will continue the test as soon as the object you want is available.
// do some tasks then click on some object
Delay(5000); // Delay for 5 seconds until we know object we want to click is ready
Sys.Process("ProcessName").Object("ObjectName").Click();
//Here is the better way to do this.
Sys.Process("ProcessName").WaitObject("ObjectName",5000).Click();
// Now if the object is ready say in 2 seconds instead of 5 it will click the object and move
// on with your test.
Of course I've still seen the "Unable to obtain item's rectangle" while using both delays and waits. Let us know when support gives you an answer on how to solve that one.
If I figure it out before then I will let you know.
So far my method of solving the problem is by using the magical Find method that comes with every object. The Find method is pretty much the answer to most problems.
Thanks so much,
Levi Bryant
// do some tasks then click on some object
Delay(5000); // Delay for 5 seconds until we know object we want to click is ready
Sys.Process("ProcessName").Object("ObjectName").Click();
//Here is the better way to do this.
Sys.Process("ProcessName").WaitObject("ObjectName",5000).Click();
// Now if the object is ready say in 2 seconds instead of 5 it will click the object and move
// on with your test.
Of course I've still seen the "Unable to obtain item's rectangle" while using both delays and waits. Let us know when support gives you an answer on how to solve that one.
If I figure it out before then I will let you know.
So far my method of solving the problem is by using the magical Find method that comes with every object. The Find method is pretty much the answer to most problems.
Thanks so much,
Levi Bryant
Related Content
Recent Discussions
- 2 days agoMW_Didata