cancel
Showing results for 
Search instead for 
Did you mean: 

Explict WaitTime Testcomplete 12.5

SOLVED
Highlighted
Occasional Contributor

Explict WaitTime Testcomplete 12.5

Hi,

 

I am currently using testcomplete 12.5v for desktop automation.

I am currently trying to delay the script execution with aqUtils.Delay(milliseconds).

 

Please help me how to use explict delay in testcomplete v12.5?

 

Note: I have browsed and found that its available in later versions. But I need the same functionality to be executed in the version mentioned above.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: Explict WaitTime Testcomplete 12.5

There is no built-in dynamic object waiting function.

 

What you can do is build something like this in VB. I don't know VB personally, but I'm sending you an example in JS.

 

function waitForObj(obj, counter) {
  var counter = counter || 60;
  for (var i = 1; i <= counter; i++) {
      if (obj.Exists == false) {
          aqUtils.Delay(1000);
      } else {
          return true;
          //break;
      }
  }
}

View solution in original post

9 REPLIES 9
Highlighted
Community Leader

Re: Explict WaitTime Testcomplete 12.5

Hi,


What do you mean by "explict delay"? Do you want to wait dynamically for an object?


and if it appears You want to go on?

Occasional Contributor

Re: Explict WaitTime Testcomplete 12.5

If your looking for some kind of delay like seleneum in python at least you can just

import time

running = True

oldtime = time.time()

while running:

   if Condition or time.time()  - oldtime > 59: #time in seconds to wait

        running = False

 

Highlighted
Community Hero

Re: Explict WaitTime Testcomplete 12.5

Hi,

 

Check documentation for .FindChildEx() and .WaitXXX() methods.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Highlighted
Occasional Contributor

Re: Explict WaitTime Testcomplete 12.5

Yes, this is what i need it. It should wait dynamically for an object and if it appears it should be proceed.

 

Please tell me, what type of function can be used for this using vbscripting?

Highlighted
Occasional Contributor

Re: Explict WaitTime Testcomplete 12.5

Thanks. For me It should wait dynamically for an object and if it appears it should be proceed.

 

Please tell me, what type of function can be used for this using vbscripting?

Highlighted
Occasional Contributor

Re: Explict WaitTime Testcomplete 12.5

Thanks. But please tell me that the function you said will behave as It should wait dynamically for an object and if it appears it should be proceed.

 

If Yes, please tell me, wheather this function can be used by vbscripting?

Highlighted
Community Leader

Re: Explict WaitTime Testcomplete 12.5

There is no built-in dynamic object waiting function.

 

What you can do is build something like this in VB. I don't know VB personally, but I'm sending you an example in JS.

 

function waitForObj(obj, counter) {
  var counter = counter || 60;
  for (var i = 1; i <= counter; i++) {
      if (obj.Exists == false) {
          aqUtils.Delay(1000);
      } else {
          return true;
          //break;
      }
  }
}

View solution in original post

Highlighted
Occasional Contributor

Re: Explict WaitTime Testcomplete 12.5

Thanks. I will implement this idea.

Highlighted
Community Hero

Re: Explict WaitTime Testcomplete 12.5

Hi,

 

Have you read the documentation for the methods that I mentioned?

They do exactly what you have asked for - they wait for the object to appear within specified timeout and proceed.

All methods and functions provided by TestComplete can be used with any scripting language supported by TestComplete.

 

And, unlike a great many of other software, TestComplete provides a really comprehensive documentation which is definitely worth detailed reading.

 

P.S. I am doubting that the code provided by @Wamboo will work - if the function is provided by an empty object (as a result of the failed search), then this object will not get a reference to the sought for object even if this sought for object appears during the loop. Thus obj.Exists will never become true.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================