Forum Discussion

kylegogtp's avatar
kylegogtp
Contributor
3 years ago

Ignoring auto-wait timeouts for steps

Hi,

 

I am looking for a way to ignore the Auto-wait timeout and have my loop end the step.

 

Currently, I have a basic loop waiting for an item to be enabled, but it times out before the item ever gets enabled. I have the auto-wait Timeouts set to the maximum. It can take up to a couple hours for the item to be enabled to be clickable.

 

Thanks,

    • kylegogtp's avatar
      kylegogtp
      Contributor

      Here is my code. Very basic and I need to add something to cause the loop to end, but I need to first figure out how to not have AutoTimeout to not time it out.

       

      //Enter a mapped object and how long to delay after it is enabled.
      function loopWaitForObjectEnabled(mappedObject, ms)
      {
      var i = 0;
      while (! mappedObject["Enabled"])
      {
      i++;
      }
      Delay(ms);
      }

       

      [
      i++;
      }
      Delay(ms);
      }

      • Marsha_R's avatar
        Marsha_R
        Moderator

        Have you tried setting the auto wait to 0?  

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    You may consider a code like this:

      var iStartTime, iStopTime, iTime;
      var timeoutMS = 30 * 2 * 1000; // 30sec * 2 = 60sec = 1min
    
      iStartTime = Win32API.GetTickCount();
      iStopTime = iStartTime + timeoutMS;
    
      do
      {
        aqUtils.Delay(500);
        iTime = Win32API.GetTickCount();
      }
      while ((!<obj>.Enabled) && (iStopTime >= iTime));