Solved
Forum Discussion
baxatob
8 years agoCommunity Hero
Hi,
Set Project -> Properties -> Playback -> Auto-wait timeout value to 2000
or use Options.Run.Timeout = 2000 to control timeouts programatically.
- rushikesh8 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.
- baxatob8 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(); } }