Grouping Elements in Object Maps

When items in an object map have no consistent parent object, you can group these elements by adding a new tree item with the locator ".", which is the locator for the current element in Xpath.

Warning: Grouping object map items affects every visual test or script that uses these items. Every visual test or script that uses these items must be changed manually to use the new locators.
  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 edit.
    • Right-click the object map that you want to edit 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. Right click on the tree item below which you want to add the new structuring item and choose Insert New.
  6. Double click the Item name field of the new object map item.
  7. Type the item name that you want to use and then press Enter. If you use an invalid character, the item name displays in red. The new name displays in the Item name list.
  8. Click the Locator path field of the new object map item and type . into the field.
  9. Press Enter.
  10. For every object map item that you want to relocate to a new location under the new item:
    1. Right click on the item that you want to relocate and choose Cut tree.
    2. Right click on the new structuring item and choose Paste.
  11. Perform one of the following steps:
    • Click Save to save your changes and continue working on the object map.

      Silk Test Workbench saves your changes as a new version and the object map mode goes back to read only.

    • Click Save and close to save your changes and exit the object map.

      Silk Test Workbench saves your changes as a new version and the object map is available for other users to modify.