Visual Relationship identifier in UFT
In any application, if objects are dynamic and they do not have any stable property. Then, It is a bit challenging to work with these kind of objects.In such cases, visual relationship identifier(VRI) concept will be helpful.
How VRI works?
As its name says, relationship,It works on the relationship with its neighbor objects. Look at the below screen which contains a edit box and a Find button. Suppose, we need to enter some data into edit box but edit box does not have any unique property or there are multiple edit box with same properties. Then, It becomes a challenge to work with these kind of objects.
In such case, we look for any object near by it which is a stable object. we create a relationship between them, so expected objects can be identified with the help of stable object unless until stable object changes its position.
In our case, we observe that stable object is ‘Find’ button next to Edit box. So,we will create relationship between them.
How to develop the relationship between these 2 objects?
1. Add both the objects to the object repository
2. Select the editbox object and click on the highlighted button.
3. Window shown below will open. Click on the Plus(+) button.
4. After clicking plus(+) button, below window will open where we need to select the object with which we need to establish the relationship.Click on OK.
5. It will open the window shown below.It is the window where we need to define the relationship. As we can see ‘Find’ button is right side of the ‘EditBox’. So , select the appropriate position.It will show the description as well(Highlighted).
6. You can click on the Preview button to see if it identifies the object on the basis of relationship or not.
It identifies the object correctly and show the message ‘1 object found’ as shown below in the screen shot.
Now, You can use the object ‘Editbox’ in the code and it works normally.