BuiltIn.Delay Method

Applies to TestComplete 15.45, last modified on December 01, 2022
This method is obsolete. See the Remarks section below.

Description

The Delay method lets you delay script execution for some period of time. You may want to delay 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

BuiltIn.Delay(ms, Str)

ms [in]    Required    Integer    
Str [in]    Optional    String Default value: “Delays 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 during which you want to delay script execution.

Str

Specifies the text displayed by the TestComplete indicator icon during a delay. The default value of Str is “Delays script execution for ... milliseconds.”, where ellipsis means the number of milliseconds specified by the ms parameter.

You can format the Str string, for example, specify the delay time value within it:

JavaScript, JScript

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

Python

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

VBScript

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

DelphiScript

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

C++Script, C#Script

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

If you need more sophisticated formatting, use the aqString.Format method.

Result Value

None.

Remarks

This method is obsolete. It is supported for backward compatibility only. To delay the test execution, use the aqUtils.Delay method.

See Also

Delaying Test Execution
Delay Method
Format Method
Pause Method

Highlight search results