Solved
Forum Discussion
rushikesh
8 years agoContributor
Hi, I suppose that will set Timeout for entire project as 2 sec. I want 2 sec only when particular code is running, as rest all object will require more Timeout.
baxatob
8 years agoCommunity Hero
You can implement some checkObjectExists() method:
function checkObjectExists(object, timeout) {
Options.Run.Timeout = timeout;
if object.Exists {
do_something();
}
else {
do_something_else();
}
Options.Run.Timeout = 10000;
}
- cunderw8 years agoCommunity Hero
IMO it would be much safer to use a WaitProperty so you're not adjusting the global wait.
function checkObjectExists(object, timeout) { if (!object.WaitProperty("Exists",true,timeout)) { do_something(); } else { do_something_else(); } }