Forum Discussion

Josh_147's avatar
Josh_147
Contributor
3 years ago

How To Set Auto-Wait Time Out More Than 1,000,000ms

Hi all,   I have some test cases which required to set the auto-wait time out more than 1,000,000 ms and I found that 1,000,000 is the maximum time out can be set. Is there any possible method to ...
  • rraghvani's avatar
    3 years ago

    The example code below will wait until Edge Tab is opened or until time limit is reached i.e. 17 minutes (1020000 seconds)

    function Wait()
    {
        var timer = 0;
        var then = aqDateTime.Now();
        var now = then;
        
        while ((now - then) < 1020000 && !Sys.Browser("edge").WaitChild("Page(\"edge://newtab/\")", 1000).Exists)  {
            timer++;
            now = aqDateTime.Now();
        }
        
        Log.Message(`Waited ${timer} seconds`);
    }

    It will not throw an error if it can't find the object (base on the Object Browser)