VisualRelation Object
Description
An object that defines the details of a single visual relationship between a related object and the test object.
Important Information
If you need to specify more than one relative position for the same related object (for example, the related object is both left and above the test object to identify), include a separate VisualRelation object in the VisualRelationsCollection Object for each relationship.
Methods and Properties
![]() | Returns the value of a visual relation argument. |
![]() | Sets the specified value of an description properties for an object. |
![]() | The full object hierarchy path of the related object |
![]() | The position of the related object relative to the test object. |
![]() | Sets the value of a visual relation argument. |
GetArgument Method
Description
Returns the value of a visual relation argument.
Syntax
ArgVal = VisualRel.GetArgument(Argument)
Argument | Type | Description |
---|---|---|
Argument | String or Pre-defined constant | The name of the argument you want to retrieve Possible values:
|
ArgVal | Variant | A variable that will store the retrieved argument value. |
Return Value
Variant. The value of the argument.
IMPORTANT
Use the GetArgument method to retrieve the value of the Inline argument. This argument indicates whether a related object is in line with the test object.
If the value is True for a VisualRelation object whose RelativePosition Property is left or right, then the related object is horizontally in line with the test object.
If the value is True for a VisualRelation object whose RelativePosition Property is above or below, then the related object is vertically in line with the test object.
The GetArgument method returns the value of a specified item from a VisualRelation.Arguments collection object. The Arguments collection is comprised of property-value pairs, similar to the Properties Object (Collection).
Therefore, the statement:
ArgVal = VisualRel.Arguments(Argument).Value
is equivalent to:
ArgVal = VisualRel.GetArgument(Argument)
Example
RelatedObjectPath Property
Description
The full object hierarchy path of the related object. For example: "Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst1")"
Syntax
VRIColl.RelatedObjectPath
Return Value
Read-write. String.
IMPORTANT
The specified object must be an object from the test object repository. It cannot be a test object specified by a programmatic description.
RelativePosition Property
Description
The position of the related object relative to the test object.
Syntax
VRIColl.RelativePosition
Return Value
Read-write. String (or Pre-defined constant).
Possible values:
Constant | String | Description |
---|---|---|
micRelLeft | left | The related object is to the left of the test object. |
micRelRight | right | The related object is to the right of the test object. |
micRelAbove | above | The related object is above the test object. |
micRelBelow | below | The related object is below the test object. |
micRelContains | contains | The related object contains the test object. |
micRelClosestX | closest-x | The related object is the closest object on the X-axis to the test object. |
micRelClosestY | closest-y | The related object is the closest object on the Y-axis to the test object. |
micRelClosest | closest | The related object is the closest object to the test object. |
SetArgument Method
Description
Sets the value of a visual relation argument.
Syntax
VisualRel.SetArgument Argument, Value
Argument | Type | Description |
---|---|---|
Argument | String or Pre-defined constant | The name of the argument you want to set. Possible values:
|
Value | Variant | The value to assign to the argument. |
IMPORTANT
Use the SetArgument method to set the value of the Inline (or micrelinline) argument. This argument indicates whether a related object is in line with the test object.
To indicate that an object is horizontally in line with the test object, set the value to True for a VisualRelation object whose RelativePosition Property is left or right.
To indicate that an object is vertically in line with the test object, set the value to True for a VisualRelation object whose RelativePosition Property is above or below.
The SetArgument method sets the value of a specified item in a VisualRelation Arguments collection object. The Arguments collection is comprised of property-value pairs, similar to the Properties Object (Collection).
Therefore, the statement:
VisualRel.Arguments(Argument).Value = ArgVal
is equivalent to:
VisualRel.SetArgument(Argument) = ArgVal
See also:
- Crypt Object
- DataTable Object
- Description Object
- DeviceReplay Object
- DotNetFactory Object
- DTParameter Object
- DTSheet Object
- Environment Object
- Extern Object
- Parameter Object
- JSON Object
- JsonUtil Object
- MercuryTimers Object (Collection)
- MercuryTimer Object
- NV Object
- OptionalStep Object
- ParallelUtil Object
- LocalParameter Object
- PasswordUtil Object
- PathFinder Object
- PDFUtil Object
- Properties Object (Collection)
- QCUtil Object
- RandomNumber Object
- Recovery Object
- Remote Connection Object
- Reporter Object
- RepositoriesCollection Object
- Repository Object
- Services Object
- Setting Object
- SystemMonitor Object
- TestArgs Object
- TextUtil Object
- UIAutomation Object
- VisualRelation Object
- VisualRelations Object
- VisualRelationsCollection Object
- WebUtil Object
- XMLUtil Object