Stage 6: Changing the name of the test object

In this section, you modify the toolkit support set to indicate that the WebExtBook test object should be named according to its title, as per your plan (Planning support for the Book sample toolkit).

When the test object that represents a control is created, the get_property_value function (used for retrieving test object identification property values) is called with the argument logical_name to determine the name for the test object. You can implement the get_property_value function accordingly, to customize the name given the test object. If the get_property_value function does not support the logical_name property, the test object is given the name of the test object class (followed by an index, if there is more than one object of the same test object class on the same page).

To customize the name of the test object:

In the get_property_value function in the WebExtBook.js file, replace the lines:

if ( prop == "title" )
// For the "title" identification property, 

with the lines:

if ( prop == "logical_name" || prop == "title" )
// For the "title" identification property, as well as 
// the "logical_name" property

Note: You can modify the WebExtBook.js file in the toolkit support set folder and then later deploy it to OpenText Functional Testing for testing, or you can modify <OpenText Functional Testing installdir>\dat\Extensibility\Web\Toolkits\WebExtSample\WebExtBook.js directly.

The get_property_value function now returns the same text for the logical_name property used to name the test object, as it does for the title identification property. (Modify the comment that explains this function accordingly. At the end of the comment, add the following: as well as the hard coded "logical_name" property used to name the test object.)

To complete this stage, perform the procedures in Deploying and testing the toolkit support set (for stage 6).