aqUtils.Delay Method

Applies to TestComplete 15.63, last modified on April 10, 2024


Use the aqUtils.Delay method to delay the script execution for a period of time. You may want to delay the script execution when the application under test is performing some time-consuming operations (for example, when it is loading a database or connecting to a network computer).


aqUtils.Delay(ms, Str)

ms [in]    Required    Integer    
Str [in]    Optional    String Default value: “Delays the script execution for ... milliseconds.”   
Result None

Applies To

The method is applied to the following object:


The method has the following parameters:


The number of milliseconds for which you want to delay the script execution.


Specifies the text that the TestComplete indicator icon shows during a delay.

The default value of Str is “Delays the script execution for ... milliseconds.”, where the ellipsis stands for the number of milliseconds specified by the ms parameter.

You can format the Str string. For example, you can specify a delay time value in it:

JavaScript, JScript

var ms = 5000;
var HelpStr = "Delaying test run for " + ms + "milliseconds.";
aqUtils.Delay (ms, HelpStr);


ms = 5000
HelpStr = "Delaying test run for " + str(ms) + "milliseconds."
aqUtils.Delay(ms, HelpStr)


ms = 5000
HelpStr = "Delaying test run for " & ms & "milliseconds."
aqUtils.Delay ms, HelpStr


var ms, HelpStr: OleVariant;
ms := 5000;
HelpStr := 'Delaying test run for ' + aqConvert.VarToStr(ms) + 'milliseconds.';
aqUtils.Delay (ms, HelpStr);

C++Script, C#Script

var ms = 5000;
var HelpStr = "Delaying test run for " + ms + "milliseconds.";
aqUtils["Delay"](ms, HelpStr);

If there is a need for more sophisticated formatting, use the aqString.Format method.

Result Value



See the Delaying Test Execution topic for an example of using the aqUtils.Delay method.

See Also

Delaying Test Execution
Format Method
Pause Method

Highlight search results