VisualRelation Class
Class representing Visual Relations Identifier (VRI) data. Each VisualRelation class contains a reference to a test object, and up to three possible relations: horizontal relation, vertical relation, and proximity relation.
Remarks
See the UFT Developer Help Center for more information on VRI, including a diagram that illustrates the way UFT Developer interprets visual relations and the boundaries that are used for determining in-line related objects.

C# Syntax

public class VisualRelation 
Example
// Locate button number 1 in the calculator based on the location of buttons number 2 and 4. 
var button1 = calculator.Describe<IButton>(
    new ButtonDescription
    {
        NativeClass = "Button",
        Vri = 
            {
                new VisualRelation
                {
                    // Button number 2 is to the right of button number 1.
                    TestObject = button2,
                    HorizontalRelation = HorizontalVisualRelation.Right,
                },
                new VisualRelation
                {
                    // Button number 4 is above the button number 1. 
                    TestObject = button4,
                    VerticalRelation = VerticalVisualRelation.Above,
                }
            }
    });
var usernameLabel = browser.Describe<IWebElement>(new WebElementDescription
{
    TagName = @"TD",
    InnerText = @"User Name:"
});
browser.Describe<IEditField>(new EditFieldDescription
{
    Vri =
        {
            new VisualRelation{
                TestObject = usernameLabel,
                 HorizontalRelation = HorizontalVisualRelation.LeftAndInline
            }
        }
}).SetValue("MyName");
Inheritance Hierarchy

System.Object
   HP.LFT.SDK.VisualRelation

Public Constructors
 NameDescription
Public ConstructorVisualRelation ConstructorInitializes a new instance of the VisualRelation class with null values for all 3 relation elements.  
Top
Public Properties
 NameDescription
Public PropertyHorizontalRelationThe horizontal relation definition.  
Public PropertyProximityRelationThe proximity relation definition.  
Public PropertyTestObjectThe related test object.  
Public PropertyVerticalRelationThe vertical relation definition.  
Top
Public Methods
 NameDescription
Public MethodCloneCreates an exact copy of this object.  
Top