Modifying the property used to identify an object in a test script
When a test is recorded, the property that is used in the test to identify a graphic object might be inaccurate and cause the step to fail during the playback. You can modify an object property and its value, as well as the operator, to improve test robustness.
About this task
Procedure
- Click a step in the script. The object captured during the recording of this test step is highlighted in the SmartShot view.
- In the Properties table of the SmartShot view, select a relevant property. Click the View main property only icon in the filter tool bar to see the main properties displayed in bold, or click the View verifiable property only icon .
-
Drag the property to the Object Identified byfield in the test
editor. Or, right-click the property in the table and select Copy, then Paste
in the Object Identified by field. Another
method is to right click a property in the table, and select Identify step target using property.
A menu item is available for each candidate property in the context menu of the SmartShot view (see Figure 2). If the newly selected property is inappropriate, a message warns you that object recognition may be broken. The property name and its value are replaced in the Object identified by fields.
When the test is recorded, the default operator for identifying an object in a test run is equals but there are many other operators that you can use to identify objects in a mobile or web UI application. They can be used for verification points in a test to verify an attribute, for example. See Creating verification points from the SmartShot View and Creating verification points in a test.
- Save and run the test to verify that the object is identified.