Forum Discussion
Hi prabhjot88singh ,
you will be able to achieve that by using dynamic wait for the object.
the below is the code snippet which you can refer.
function waitForObject(propName, propValue, maxTime) { var object; var counter=0; if(maxTime== undefined) maxTime= 20000; do { aqUtils.Delay(100); counter+= 100; if(counter>maxTime) { Log.Warning("Time Exceeded"); return; } object= sys.browser("Chrome").page("*").Find(propName, propValue, 30, true); }while (! object.Exists) object.Click(); }
the above function takes two mandateory parameter ("property", "value") of the object for which you are waiting for. And the third parameter is "maxTime" which is not mandatory if you dont give the third parameter, it will wait untill the some time (20000 milisec).
it enters into a loop which will try finding the object untill object is identified or untill the maxTime is reached
please try this and let me know
Kind Regards,
Sathish Kumar K
- TanyaYatskovska6 years agoSmartBear Alumni (Retired)
Hi,
There are many ways to wait for an object during the test execution. WaitNNN methods are the best here. All recommended approaches are listed in the following article - please review it: https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/waiting-process-or-window-activation.html
Related Content
- 9 years ago
Recent Discussions
- 8 hours ago
- 7 days ago
- 10 days ago