Specifying the properties used for UI controls
By default, the Web UI tests use the standard object properties such as Content, ID, and Class, Xpath to find, identify and locate objects for UI controls. But some applications under test use custom attributes to describe properties for UI controls. To avoid standard behavior, you need to add them to a list of preferred identifiers and prioritize them so that they are recognized as the main object identifiers in the application under test.
Procedure
In the preferences, set a list of these properties:
- In the test editor, click
- Click Add and in the dialog that opens, enter a name for the web object property so that it can be used as an object identifier when the test is recorded and run. Then, click OK
- Use Up and Down buttons to prioritize the attributes in the list. Click Apply and OK
- When the list of preferred object identifiers is set, record the test. If the test was recorded before you set a list of preferred object identifiers, you need to run it again to apply the preferences.
- Open the test script, and check that the attributes are available in the list of properties in Object identified by.
Results
Now, the custom attributes are automatically recognized when recording the test, they are listed as main object identifiers in Object identified by and in bold, in the table of properties. You can modify the property and its value on the test steps as for the standard attributes.