aqUtils.Delay Method

Applies to TestComplete 14.0, last modified on January 23, 2019

Description

The aqUtils.Delay method allows you to delay the script execution for some 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).

Declaration

aqUtils.Delay(msStr)

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:

Parameters

The method has the following parameters:

ms

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

Str

Specifies the text displayed by the TestComplete indicator icon during a delay. The default value of Str is “Delays the script execution for ... milliseconds.”, where the ellipsis means 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);

Python

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

VBScript

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

DelphiScript

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

None.

Example

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

See Also

Delaying Test Execution
aqString.Format Method
Runner.Pause Method

Highlight search results