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:
  1. In the test editor, click Window > Preferences > Test > Recording > UI Test Recording > Preferred object identifiers
  2. 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
  3. Use Up and Down buttons to prioritize the attributes in the list. Click Apply and OKSet the list of preferred object identifiers
  4. 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.
  5. Open the test script, and check that the attributes are available in the list of properties in Object identified by. Custom attributes recognized as object identifiers in the applicationTable of properties with the custom attributes identified s main properties in the application

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.