VisualRelationsCollection Object

A 0-based collection of VisualRelation Object that together comprise the visual relation identifier element of a test object.

IMPORTANT

  • You can retrieve the collection representing the existing visual relations identifier for a test object, using the syntax:

    SetVRIColl = TestObject.GetTOProperty("visual relations")

    You can also create a new VisualRelationsCollection object using Create Method or Clone Method statements.

  • After you create or modify a VisualRelationsCollection object, you can apply it to a test object using the syntax:

    TestObject.SetTOProperty "visual relations", VRIColl

    When the SetTOProperty step runs, it replaces any existing visual relation identifier definitions for the run-time test object with those defined in the specified VisualRelationsCollection object.

  • Alternatively, you can apply the definitions in a VisualRelationsCollection to a test object using a Description Object. For example:

    Set VisualRel = VisualRelations.Create
    '...Add relations to the VisualRel collection 
    
    Set MyDesc = Description.Create
    MyDesc("nativeclass").Value = "Button"
    MyDesc("visual relations").Value = VisualRel 
    
    ParentObject("ObjName").SomeTestObject(MyDesc).Click
    

Methods and Properties

Method AddAdds a new VisualRelation Object to the collection.
Method CloneCreates a copy of the VisualRelationsCollection.
CountReturns the number of VisualRelation objects in the collection.
ItemReturns the VisualRelation Object located in the specified position.
RemoveRemoves the VisualRelation Object located in the specified location from the collection.

Back to top

Add Method

Description

Adds a new VisualRelation Object to the collection.

Syntax

SetVRel = VRIColl.Add

Return Value

The created VisualRelation Object.

Back to top

Clone Method

Description

Creates a copy of the VisualRelationsCollection.

Syntax

SetVRIColl_Copy = VRIColl.Clone

Return Value

The new (copy of the) VisualRelationsCollection Object.

Back to top

Count Property

Description

The number of VisualRelation objects in the collection.

Syntax

VRIColl.Count

Return Value

Read-only. A number.

Back to top

Item Property

Description

Returns the VisualRelation Object located in the specified position.

Syntax

Set VRIObj = VRIColl.Item

Return Value

Read-only. A VisualRelation Object.

Back to top

Remove Method

Description

Removes the VisualRelation Object located in the specified location from the collection.

Syntax

VRIColl.Remove ItemIndex

Argument

Type

Description

ItemIndex

Number

The 0-based position of the VisualRelation object to remove.

Back to top

RemoveAll Method

Description

Removes all VisualRelation objects from the collection.

Syntax

VRIColl.RemoveAll

Back to top

See also: