Renaming an Object Map Item

You can manually rename items and locators in an object map.

Warning: Renaming an object map item affects every script that uses that item. For example, if you rename the Cancel button object map item from CancelMe to Cancel, every script that uses CancelMe must be changed manually to use Cancel.

Object map items must be unique. If you try to add a duplicate object map item, Silk4J notifies you that the object must be unique.

If you use an invalid character or locator, the item name or locator text displays in red and a tooltip explains the error. Invalid characters for object map items include: \, /, <, >, ", :, *, ?, |, =, ., @, [, ]. Invalid locator paths include: empty or incomplete locator paths.

  1. In the Package Explorer, click on the Object Maps folder of the project in which the object map that you want to change is located.
  2. Choose one of the following:
    • Double-click the object map that includes the object map item that you want to rename.
    • Right-click the object map that includes the object map item that you want to rename and choose Open.
    The object map displays a hierarchy of the object map items and the locator associated with each item.
  3. Navigate to the object map item that you want to rename. For example, you might need to expand a node to locate the item that you want to rename.
  4. Click the object that you want to rename and then click the object again.
  5. 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.
  6. Press CTRL+S to save your changes
Note: All child nodes of any node in the object map tree are sorted alphabetically when you save the object map.

If any existing scripts use the item name that you changed, you must manually change the scripts to use the new item name.

Note: While recording against a web application or a mobile web app, you can directly change the name of the object map entry in the Choose Action dialog. Right-click on the object and then expand the Object identification area of the Choose Action dialog. Then you can edit the object map entry in the Object Map ID field. This functionality is available if you are testing against one of the following browsers:
  • Microsoft Edge.
  • Apple Safari.
  • Mozilla Firefox 41 or later.
  • Google Chrome 50 or later.
  • A mobile browser.