UFT Pro (LeanFT) .NET SDK Reference, Version 14.00
VisualRelation Class
Example 
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 LeanFT Help Center for more information on VRI, including a diagram that illustrates the way LeanFT interprets visual relations and the boundaries that are used for determining in-line related objects.
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("mercury");
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 defintion.  
Top
Public Methods
 NameDescription
Public MethodCloneCreates an exact copy of this object.  
Top