Forum Discussion

Logiv's avatar
Logiv
Contributor
5 years ago

Adding delay to keyword test - not based on object visible

Hello,

I am trying to add a delay in a keyword test. There is no new window or object that appear during my test, but my program has an internal process that takes a few second to execute. I cannot test for Object visible Wait Property since there is no new object. 

How can I achieve a delay without testing for an object? 

Thanks!

  • Hi,

     

    Miscellaneous Category contains Delay operaton. Does it help?

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Miscellaneous Category contains Delay operaton. Does it help?

     

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        While you can add a physical delay, I'd still aim towards finding something more dynamic.  

         

        So, this internal process.  What does it do?  Does it update an SQL table? Create a file? etc?  As Marsha_R suggested, if you were doing this manually, how would you know the internal process is complete?  Would you click on something, check a value, and then wait and repeat the process?

         

        The reason why I'd not do a physical delay is two-fold:

         

        1) The process may take LESS time on some iterations through the test than you have the delay set for which would mean that you would have an automation process sitting doing nothing for a time when it could be continuing the process.

        2) The process may take MORE time on some iterations through the test than you have the delay set for which would mean that you could end up with an invalid test because you didn't wait long enough.

         

        So, finding a dynamic way to check the process and determine if it's complete will minimize the idle time of your process while allowing for long potential delays by setting a maximum timeout.

    • Logiv's avatar
      Logiv
      Contributor

      Thank you Alex, it worked great. I just started using TestComplete and I am learning :)