Forum Discussion

joeychou99's avatar
joeychou99
Regular Visitor
5 years ago

TestComplete Verifying long wait time

I'm currently trying to verify a visual prompt reminder kinda like an icon showing up every hour. Normal I would just do a WaitProperty attaching isVisible, but I think waiting an hour pretty absurd....
  • Wamboo's avatar
    5 years ago

    Hi,

     

    I suggest You write an interval function for these actions:

    use Timer object:

     

    Example:

     

     

    // unit name 'Example1'
    function run() {
      MyTimer = Utils.Timers.Add(3000, "Example1.timerRoutine", true);
    }
    
    function timerRoutine() {
      Indicator.PushText("FROM TIMER!")
    }
    
    // unit name 'Example2'
    //USEUNIT Example1
    function runTimer() {
      Example1.run();  
    
      for(y = 1; y < 1000000; y++) {
        Indicator.PushText("waiting for timer!")
      }
    
    }

     

     

    If You run this function, you can see that every 3s indicator will switch text from "waiting for timer!" to "FROM TIMER!"

    Write Your own function to look for that popUp every 1h. But be careful.

     

     

    When a timer elapses, TestComplete pauses the test to run the timer’s routine. The test is resumed after the timer routine has finished running.

    Because of this, try to make timer routines as fast as possible. Using many timers with long-running routines can slow down the test run.