Delaying Test Execution

Applies to TestComplete 15.47, last modified on January 20, 2023

You may need to delay the test run at some point. For instance, the application under test may have to wait until the end of a time-consuming operation, such as loading a database or connecting to a network printer or another computer. Without a sufficient delay, the test run would have unexpected results.

You can set a pause between operations in a keyword test. To do this, place the Delay operation into the test before the delayed operation and specify the Delay Time parameter.

To delay the script run, use the aqUtils.Delay method. This method uses two parameters: the first parameter is the delay time, in milliseconds; the second parameter is optional and specifies the text to show in the indicator. For example, the following code delays the script run for two seconds:

JavaScript, JScript

aqUtils.Delay(2000);

Python

aqUtils.Delay(2000)

VBScript

aqUtils.Delay 2000

DelphiScript

aqUtils.Delay(2000);

C++Script, C#Script

aqUtils["Delay"](2000);

You can also use delays in a loop as to wait for a specific application’s response. For examples, see Waiting for Object State Changes.

See Also

Delay Operation
Waiting for an Object, Process or Window Activation
Waiting for Object State Changes

Highlight search results