Updating Object Maps from the Test Application

If items in the test application change, you can use the Object Map UI to update the locators for these items.

  1. Choose View > Asset Browser or select Get Started > Asset Browser in the Start Screen.
  2. From the Asset Types list, select Object Map. Any existing object maps for the selected project display in the right pane.
    Tip: If you do not see the object map that you want to edit, ensure that the correct project is selected in the Active Project list.
  3. Choose one of the following:
    • Double-click the object map that you want to use.
    • Right-click the object map that you want to use and choose Open.
    The object map displays a hierarchy of the object map items and the locator associated with each item.
    Note: If another user is currently editing the object map that you select, a message box notifies you and names the user who currently has the object map locked.
  4. Click Edit. By default, the object map is read only. Clicking Edit gives you read/write access and ensures that no other users can edit the entries while you are modifying them. You can also press F2 to edit the currently selected field in the object map. The Edit button changes to Revert. If you want to undo any changes that you make during this session, click Revert.
  5. Click Update Locator. The Identify Object dialog box displays and Silk Test Workbench opens the test application.
  6. Position the mouse cursor over the object that you want to record and press CTRL+ALT. Silk Test Workbench displays the locator string in the Locator text field.
  7. Select the locator that you want to use in the Locator Details table.
  8. Remove any attributes that you do not want to use from the locator that is displayed in the Locator text field.
  9. Click Validate Locator to validate that the locator works.
  10. Click Paste Locator to Editor to update the locator in the object map.
  11. Save the changed object map.
When you update an object map item from the AUT, you can change only the XPath representations of leaf nodes in the object map tree. You cannot change the XPath representations of any parent nodes. When the XPath representations of higher-level nodesin the object map tree are not consistent after the update, an error message displays.

Example

For example, suppose you have an object map item with an object map ID that has the following three hierarchy levels:
WebBrowser.Dialog.Cancel
The corresponding XPath representation of these hierarchy levels is the following:
 /BrowserApplication//Dialog//PushButton[@caption='Cancel']
  • First hierarchy level: /BrowserApplication
  • Second hierarchy level: //Dialog
  • Third hierarchy level: //PushButton[@caption='Cancel']
You can use the following locator to update the object map item:
 /BrowserApplication//Dialog//PushButton[@id='123']
  • First hierarchy level: /BrowserApplication
  • Second hierarchy level: //Dialog
  • Third hierarchy level: //PushButton[@id='123']
You cannot use the following locator cannot to update the object map item, because the second level hierarchy nodes do not match:
 /BrowserApplication//BrowserWindow//PushButton[@id='9999999']
  • First hierarchy level: /BrowserApplication
  • Second hierarchy level: //BrowserWindow
  • Third hierarchy level: //PushButton[@id='9999999']