If there is an existing test object class that provides partial support for your control, but needs some modification, for example, a different naming convention for test objects in the class, or additional or modified test object methods, you create a new test object class to represent the control. When you create the new test object class, you base this test object class on the existing test object class, inheriting all of its test object methods.
To extend an existing test object class, you define the name of the base test object class in the ClassInfo\BaseClassInfoName attribute in the ClassInfo element for the new test object class in the test object configuration file. This declares that the new test object class supports all of the test object methods of the base test object class in addition to any that you define for the new test object class.
When you choose a test object class to extend consider the following:
Your test object class inherits the operation definitions from the test object class. Choose a test object class with a set of operations functionally relevant for your control.
To inherit the implementation for the base class operations, your control must include an element of the type that matches the base test object class.
In addition, if the control includes a base element, UFT One uses the base test object class implementation to retrieve the identification property values when the following conditions are met:
In the test object configuration file, you defined identification properties for the new test object class with the same names as properties of the base test object class.
If the base element is the root element of the control that you are supporting, UFT One recognizes the base element and uses the base test class implementation for test object methods and identification properties that you do not implement.
<Control TestObjectClass=MyWebTable> <Settings> <variable name="default_imp_file " value="HPTable.js"/> <variable name="func_to_get_base_elem" value="get_base_table"/> </Settings> </Control>
- func_to_get_table_data: Enables you to retrieve an array of table information. This function returns a two-part array. The first part of the array returns the table column strings and the second returns the contents of the rows in the table.
- func_to_get_cell_elem: Enables you to retrieve data from a specific cell.
These functions are set in the <Settings> section of the Control element in the toolkit configuration file. For details on these functions, see the Web Add-in Extensibility Toolkit Configuration Schema Help.
If you have an object that you update - for example, if it was previously recognized as a WebElement but now you changed it to be recognized as a MyToolkitElement - you can instruct UFT One how to recognize this object in previous test that still use the old object name/type.
In the Settings Element, you add a line with the "other supported types" attribute and then name the previously supported types in the value. This enables UFT One to find the object in its current representation as well as previous ones.
<Control TestObjectClass=MyWebTable> <Settings> <variable name="default_imp_file " value="HPTable.js"/> <variable name="func_to_get_base_elem" value="get_base_table"/> <variable name="other supported types" value="WebTable"/> </Settings> </Control>