Run Method

Applies to TestComplete 15.40, last modified on March 25, 2022

The object-driven testing (ODT) functionality is deprecated. Do not use it to create new tests. It will be removed from the product in one of the future releases. As an alternative, you can create custom classes in your scripts. For more information, see Alternatives to the ODT functionality.

Description

The ArrayObject.Run method processes each array item and walks down the custom object hierarchy in the manner described in the Controlling Object-Driven Tests topic.

Declaration

ArrayObjectObj.Run()

ArrayObjectObj An expression, variable or parameter that specifies a reference to an ArrayObject object
Result None

Applies To

The method is applied to the following object:

Result Value

None.

Example

The code below creates a new data group, adds a new variable to it and adds a property of the array type to this variable. After that, the routine adds two items to the created property and then calls the Run method to process these items.

JavaScript, JScript

function RunningItemsExample()
{
     // Adds a new data group
    var Data = ODT.Data.AddGroup("TestData");
    // Adds a new variable of the MyClass class type
    var sVar = Data.AddVarOfClassType("TestVar", "MyClass");
    // Adds a new property of the array type
    var Prop = sVar.AddPropOfArrayType("MyProperty");
    // Adds two items to the MyProperty property
    Prop.AddItem(123);
    Prop.AddItem("MyString");
    // Processes the items of the MyProperty array
    Prop.Run();
}

VBScript

Sub RunningItemsExample
     ' Adds a new data group
    Set Data = ODT.Data.AddGroup("TestData")
    ' Adds a new variable of the MyClass class type
    Set sVar = Data.AddVarOfClassType("TestVar", "MyClass")
    ' Adds a new property of the array type
    Set Prop = sVar.AddPropOfArrayType("MyProperty")
    ' Adds two items to the MyProperty property
    Prop.AddItem(123)
    Prop.AddItem("MyString")
    ' Processes the items of the MyProperty array
    Prop.Run
End Sub

DelphiScript

function RunningItemsExample;
var Data, sVar, Prop;
begin
     // Adds a new data group
    Data := ODT.Data.AddGroup('TestData');
    // Adds a new variable of the MyClass class type
    sVar := Data.AddVarOfClassType('TestVar', 'MyClass');
    // Adds a new property of the array type
    Prop := sVar.AddPropOfArrayType('MyProperty');
    // Adds two items to the MyProperty property
    Prop.AddItem(123);
    Prop.AddItem('MyString');
    // Processes the items of the MyProperty array
    Prop.Run();
end;

C++Script, C#Script

function RunningItemsExample()
{
     // Adds a new data group
    var Data = ODT["Data"]["AddGroup"]("TestData");
    // Adds a new variable of the MyClass class type
    var sVar = Data["AddVarOfClassType"]( "TestVar", "MyClass" );
    // Adds a new property of the array type
    var Prop = sVar["AddPropOfArrayType"]("MyProperty");
    // Adds two items to the MyProperty property
    Prop["AddItem"](123);
    Prop["AddItem"]("MyString");
    // Processes the items of the MyProperty array
    Prop["Run"]();
}

See Also

Run Method
Run Method
Run Method
Controlling Object-Driven Tests

Highlight search results