Share this page

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 OpenText Functional Testing for Developers Help Center for more information on VRI, including a diagram that illustrates the way OpenText Functional Testing for Developers 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

| Name | Description
--- | --- | ---
| VisualRelation Constructor | Initializes a new instance of the VisualRelation class with null values for all 3 relation elements.

Top
Public Properties

| Name | Description
--- | --- | ---
| HorizontalRelation | The horizontal relation definition.
| ProximityRelation | The proximity relation definition.
| TestObject | The related test object.
| VerticalRelation | The vertical relation definition.

Top
Public Methods

| Name | Description
--- | --- | ---
| Clone | Creates an exact copy of this object.

Top

Tips to improve your search results... OpenText™ Functional Testing for Developers .NET SDK Version: 25.2 OpenText™ Functional Testing for Developers SDK 25.2 All View Local Help Center View Online Help Center Version: