Owner Property

Applies to TestComplete 15.45, last modified on December 01, 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

Use the ArrayObject.Owner property to get an object that has a reference to the ArrayObject array object.

Declaration

ArrayObjectObj.Owner

Read-Only Property Variant
ArrayObjectObj An expression, variable or parameter that specifies a reference to an ArrayObject object

Applies To

The property is applied to the following object:

Property Value

An object that has a reference to the given array object.

Example

The code below uses the Owner property to access the object that has a reference to the MyProperty property and then uses this object to add the New property to it.

JavaScript, JScript

function OwnerExample()
{
     // 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 to the TestVar variable
    var Prop = sVar.AddPropOfArrayType("MyProperty");
    // Adds two items to the MyProperty property
    Prop.AddItem(123);
    Prop.AddItem("MyString");
    // Adds one more property to the TestVar variable
    Prop.Owner.AddProperty("New");
}

VBScript

Sub OwnerExample
     ' 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 to the TestVar variable
    Set Prop = sVar.AddPropOfArrayType("MyProperty")
    ' Adds two items to the MyProperty property
    Prop.AddItem(123)
    Prop.AddItem("MyString")
    ' Adds one more property to the TestVar variable
    Prop.Owner.AddProperty("New")
End Sub

DelphiScript

function OwnerExample;
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 to the TestVar variable
    Prop := sVar.AddPropOfArrayType('MyProperty');
    // Adds two items to the MyProperty property
    Prop.AddItem(123);
    Prop.AddItem('MyString');
    // Adds one more property to the TestVar variable
    Prop.Owner.AddProperty('New');
end;

C++Script, C#Script

function OwnerExample()
{
     // 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 to the TestVar variable
    var Prop = sVar["AddPropOfArrayType"]("MyProperty");
    // Adds two items to the MyProperty property
    Prop["AddItem"](123);
    Prop["AddItem"]("MyString");
    // Adds one more property to the TestVar variable
    Prop["Owner"]["AddProperty"]("New");
}

See Also

Owner Property

Highlight search results