Monday, 20 April 2015

QTP 1 - How to identify an object from the list of objects whose properties are changing in every build ?

To automate such scenarios we need to use "getROproperties" and "setTO properties" methods. First of all we need to get all the unique properties of a continuously changing object through getROproperties and then we need to set these properties through setTO properties in the OR. Once the properties are set in Object repositories we can use those properties to uniquely identify any object.
For example : suppose there are 10 links on a page and we need to click on the 5th link out of those 10, but for all of them the properties are changing , then how will we identify the link.

-> First of all we need to count the childobjects having the miclass : "link", now one by one we can set the properties to OR through GetROProperties and SetTOProperties. Now we can easily click on the link using the childobjects at 4th position.

-> we can also use indexing , a ordinal identifier to identify object at fourth place.

No comments:

Post a Comment