Is it possible to use VRI with LeanFT?

  • Questions
  • Is it possible to use VRI with LeanFT?
Question ID: 106313

Can I use the visual relationship identifier with LeanFT like I could with UFT? Since it doesn’t have the object repository, I didn’t know if this was possible or not.

Marked as spam
Posted by (Questions: 175, Answers: 22)
Asked on August 7, 2015 2:23 pm
Answers (1)
Private answer

Your Visual Relation Indentification (VRI) definition is comprised of a set of relation objects. For each relation, you indicate an existing test object and what that test object's visual relation is to the test object you are now defining.

The possible relations are defined in the HorizontalVisualRelation, VerticalVisualRelation, and ProximityVisualRelation enumerations.
The below code is an example HP has that involves using the Windows calculator application. It illustrates how you can identify buttons based on the location of the other surrounding buttons in the application.

In the example, the '1' button has a '2' button to the right of it and a '4' button above it. You could use these relations to describe the '1' button like this:

//Create the Calulator description
var calculatorDescription = new WindowDescription
WindowClassRegExp = ''CalcFrame'',
WindowTitleRegExp = ''Calculator''

//Create the calculator parent Window test object
IWindow calculator = Desktop.Describe(calculatorDescription);

//Create test objects for button 2 and button 4
var button2 =
calculator.Describe(new ButtonDescription { WindowId = 132, NativeClass = ''Button'' });
var button4 =
calculator.Describe(new ButtonDescription { WindowId = 134, NativeClass = ''Button'' });

//Create a test object for button 1 based on its visual relationship to buttons 2 and 4
var button1 = calculator.Describe(
new ButtonDescription
NativeClass = ''Button'',
Vri =
new Relation
TestObject = button2,
HorizontalRelation = HorizontalVriRelation.Right,
new Relation
TestObject = button4,
VerticalRelation = VerticalVriRelation.Above,

Marked as spam
Posted by (Questions: 2, Answers: 425)
Answered on August 7, 2015 2:26 pm