Modifying Object Recognition Properties in RFT
prakash s chauhan 27000140Y5 Visits (4733)
Sometimes you may want Rational Functional Tester [RFT] to capture some additional properties which are exposed by a control but not captured by RFT by default. By capturing what I mean is storing these properties (called recognition properties) in the Object map which RFT is eventually going to use to find the object during playback.
The application under test(AUT) is an HTML Application with lots of DIV elements, which render themselves like menu controls , and the user would like to have the text property of the DIV to be captured in the Object Map.
Here is the html source code for a sample DIV control-
<title>Sample DIV Test</title>
<div id="intro">I am inside a div</div>
With default behaviour, if this <div> element is saved in the object map then, this is how its recognition properties are going to appear in the object map --
However we are(for some reason) interested in capturing the Text i.e "I am inside a div" also to the object map. Let's suppose that the reason is to make the object recognition more robust.
RFT provides us a toolcalled the Object Properties Configuration Tool for this very purpose:
The selected domain would show the Object Classes registered for that domain. (For HTML usually the class is equvalent to HTML TAG , in the format of Html.<TAGNAME> for eg Html.A for anchor tag <a>
or Html.INPUT.text for and <input type="text"> tag)
If the object we want to edit the recognition properties for, is listed here then simply select the object and then under the section Object Recognition Properties .. You can Add new properties or Remove and existing properties or change the Default weight for the control.
Here add/remove any new property you want by using the "Add" button.
After this if you insert the same DIV element again (by Recording or Insert Object Wizard) the Object map will show you the object Recognition properties as follows :
If you had the same object recorded before and it is there in the Object Map, then you might end up with two entries in the Object Map for the same control , in that case you can unify the two objects.
RFT gives user the capability to decide what properties should be captured for the object recognition which will further determine how robust the playback is going to be.
Remember that modification to the Object Recognition Properties is not specific to one project or script but it modifies the RFT behaviour so any project that is created after this modification, will have the new recognition property(ies) in the Object Map. Also it does not affect the existing objects map so if a property was not captured before, then RFT will not bother to consider that property for that scripts playback, even though it has now been added through the wizard as one of the recognition properties.