ClassRef Property

Applies to TestComplete 15.70, last modified on December 17, 2024

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 Object.ClassRef property to get the Class object on which the Object object is based.

Declaration

ObjectObj.ClassRef

Read-Only Property A Class object
ObjectObj An expression, variable or parameter that specifies a reference to an Object object

Applies To

The property is applied to the following object:

Property Value

The Class object on which the object is based.

Example

The following example demonstrates how you can obtain the class on which the current object is based.

JavaScript, JScript

function ObjectSample()
{
  …
  // Creates an object that contains an instance of the class
  var MyObject = ODT.Classes.New("NewClass");

  …
  // Obtains the class on which the object is based
  var NewClass = MyObject.ClassRef;
  …

}

VBScript

Sub ObjectSample

  …
  ' Creates an object that contains an instance of the class
  Set MyObject = ODT.Classes.New("NewClass")

  …
  ' Obtains the class on which the object is based
  Set NewClass = MyObject.ClassRef
  …

End Sub

DelphiScript

procedure ObjectSample();
var MyObject, NewClass;
begin
  …
  // Creates an object that contains an instance of the class
  MyObject := ODT.Classes.New('NewClass');

  …
  // Obtains the class on which the object is based
  NewClass := MyObject.ClassRef;
  …

end;

C++Script, C#Script

function ObjectSample()
{
  …
  // Creates an object that contains an instance of the class
  var MyObject = ODT["Classes"]["New"]("NewClass");

  …
  // Obtains the class on which the object is based
  var NewClass = MyObject["ClassRef"];
  …

}

See Also

Class Object

Highlight search results