Implementing Support for Identification Properties

In the test object configuration file you defined the identification properties for your test object classes. When a test runs, it needs to retrieve the values for these properties. Identification property run-time values are used in different test object methods, such as GetROProperty. Identification property run-time values are also required for different basic capabilities, such as creating checkpoints and outputting values.

To support retrieving the run-time values of identification properties, you need to implement a JavaScript function that accepts a PropertyName parameter and returns the value of any property the test run requests. (Only lowercase letters are used in identification property names. If the identification property name in the test object configuration file contains uppercase letters, they are converted to lowercase.)

This function must return the property value in one of the following formats: String, Integer, Boolean, or array. When returning an array, use the toSafeArray function to convert the array to the format that OpenText Functional Testing expects. When you provide an identification property value in an array format, the array is converted to a semicolon-delimited string.

For more information on writing JavaScript functions for Web Add-in Extensibility, see Designing JavaScript functions for your toolkit support set.

OpenText Functional Testing uses the base test object class implementation to retrieve the identification property values when the following conditions are met:

  • The control includes a base element (for more information, see Extending an Existing Test Object Class).

  • The identification property is defined in the test object configuration file with the same name as a base test object class property.

  • You do not provide a function that returns a value for that identification property.

Implement your JavaScript function to return a value for the identification properties defined in the test object configuration file in the following situations:

  • Base test object class implementation for retrieving the value for this identification property value is not available.

  • The base test object class implementation does not meet your needs.

By designing the function that returns identification property values to return a value for the logical_name property, you can control how OpenText Functional Testing names test objects of this test object class. For more information, see Customizing the Test Object Name.

In the toolkit configuration file, you can specify the JavaScript file in which you implemented the JavaScript function that retrieves property values. You can also specify the name of the function that you implemented for this purpose (in the Control\Run\Properties element). However, if you do not specify a function name, get_property_value (PropertyName) is called and this is the function that you must implement. If you do not specify a file name, the function is called from the default JavaScript file you specified in the Control\Settings element (at the test object class level) or in the Controls\Settings element (at the toolkit level). For more information, see the Toolkit Configuration Schema Help.

After you create support for retrieving the run-time values of identification properties, you can test your toolkit support set. You want to test that it correctly enables running checkpoints on your Web elements, working with output property values, displaying the property values in the Object Spy, and running test steps with the GetROProperty operation. For more information on testing your toolkit support set, see Testing the Toolkit Support Set During Development.