Forum Discussion

Wanderings's avatar
Wanderings
Occasional Contributor
8 years ago
Solved

For keyword testing, is there a way to add a delay until the program has moved on to the next step?

I have an operation that has a variable delay before it is completed and the screen is transitioned to the next part of the program.

 

Is there a way to add a variable delay to wait until this operation is complete?  Would it be something like adding a While loop to test for the next screen's visibility?  Thanks!

  • I would use the On-Screen Object - WaitProperty.  See attached screenshots to correspond below.

     

    1) Select On-Screen object from the TestActions tab.

    2) Select the object you want to become visible (or no longer visible)

    3) Select WaitProperty for the Method/Property

    4) Set the PropertyName to Visible

        Set the PropertyValue to True (visible) or False (not visible)

        Set the WaitTime to the desired time.  This field uses miliseconds so 1000 = 1 second, 10000 = 10 seconds...

     

    I use this all the time and it's great!

     

    Hope this helps.  Good luck!

     

10 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

     

    Yes, exactly that.  You might want to put a limit on the test though, so you don't end up stuck in that loop forever if the next screen doesn't come up.

     

  • cunderw's avatar
    cunderw
    Community Hero

    As Marsha said you can do a while loop. You can also do a WaitChild as well if you know what object will be visible on the next screen. 

    • Wanderings's avatar
      Wanderings
      Occasional Contributor

      Thanks all.  The While loop works as a delay until the program hits the next step, but now Test Complete throws an error when it does not find the object it was looping on!  Is there a way to suppress this error for this specific step/loop?  

       

      Edit:  I'm having troubles implementing the WaitChild option in a Keyword test.  Will have to do more research for that.

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Let's see a screenshot of your While loop.

  • DCat1223's avatar
    DCat1223
    Frequent Contributor

    I would use the On-Screen Object - WaitProperty.  See attached screenshots to correspond below.

     

    1) Select On-Screen object from the TestActions tab.

    2) Select the object you want to become visible (or no longer visible)

    3) Select WaitProperty for the Method/Property

    4) Set the PropertyName to Visible

        Set the PropertyValue to True (visible) or False (not visible)

        Set the WaitTime to the desired time.  This field uses miliseconds so 1000 = 1 second, 10000 = 10 seconds...

     

    I use this all the time and it's great!

     

    Hope this helps.  Good luck!

     

    • Wanderings's avatar
      Wanderings
      Occasional Contributor

      Thanks all.  DCat1223's solution was exactly what I was looking for - and easiest to implement!  

      • DCat1223's avatar
        DCat1223
        Frequent Contributor

        My pleasure!  I get so much out of this forum, it's nice to be able to give back for a change!