Leverage the improved IDE integration of the Script-Based Object Map

Last edited on

As the name suggests the Script-Based Object Map is much more tightly coupled to the scripting languages than the old Text-Based Object Map. During development of the Script-Based Object Map we spent a lot of time on improving the user experience when writing and maintaining test scripts.

We tried to make sure that users can benefit as much as possible from the script language IDE integration features, while maintaining the existing functionality of the old Text-Based Object Map.

Following is a short overview of the features you can leverage when writing and maintaining tests.

Auto-completion for Symbolic Names

Since Symbolic Names are now variables and part of the test scripts you can use auto-completion when editing or writing tests manually. With Text-Based Symbolic Names there was no auto completion, so you either had to copy or remember the names.

Improved maintenance of test

The following features will help you with the maintenance of existing tests

Renaming of Symbolic Names

Using the refactoring feature of the IDE you can now not just rename Symbolic Names but also automatically rename all occurrences of those Symbolic Names in your test scripts. You can trigger the rename operation using the shortcut

Alt + Shift + R

or you can use the refactoring menu inside the main toolbar or context menu.

Find all references and declarations of a Symbolic Name

It is now much easier to find out where a Symbolic Name is used. In Python you can use the Refactoring menu and chose Find all occurrences, while in JavaScript, Ruby and Tcl you can use the Search context menu (in this case the search differentiates between References and Declarations).

Add documentation to Symbolic Names

In JavaScript, Ruby and Tcl you can now add documentation to Symbolic Names and view it by hovering over Symbolic Names in test scripts. This can make it easier to read and understand the script code which will improve maintainability.

In Python hovering over a Symbolic Name will show the definition of the name.

Most Integration Features of Text-Based Object Maps will continue to work

While they aren't needed anymore most of the workflows you might have gotten used to will continue to work.

Open Symbolic Name

Open Symbolic Name will continue to work and take you to the Scripted Object Map Editor.

Use the Object Map Editor to edit the Script-Based Object Map

Even though the Script-Based Object Map is now defined in a script file and you really should consider editing it there to make use of all the features the script languages have to offer, it's still possible to edit it within the Object Map Editor, even if you have manually changed the script code behind it.

The Editor will try to keep all your manual changes, but when you encounter a refactoring dialog pay close attention to check which code gets overwritten. While it's pretty good at not overwriting any of your manual changes it's not perfect either.

You can use the Text-Based and Script-Based Object Map side by side

It's recommended to fully switch to the Script-Based Object Map but you can also just use it along side the old Object Map. Just switch your test suites to use the Script-Based Object Map and all newly recorded names will use the Script-Based Object Map while all existing Text-Based Object Names will continue to work.

Conversion Utility

We created a basic conversion utility to help you migrate to the Script-Based Object Map.