froglogic / Blog / Upcoming feature “script-based object map”

Upcoming feature “script-based object map”

Upcoming feature: Script-Based Object Map

In July 2016 two blog articles presented an alternative script-based Object Map approach for advanced management of object names. The idea is to use script language variables instead of string-based Symbolic Names for object look-up and interaction functions.

As shown in the examples below, language specific dictionaries with wildcard and regular expression support are used to define the properties of object names and since the Object Map is written in the same language as the tests, Squish IDE features like code completion, jump to definition and refactoring make usage of object names quite simple.

In one of the next Squish releases the script-based Object Map will be supported for all five script languages, including these main features:

  • Recording
  • Playback
  • Script framework for “home brewn” Object Maps

How will it look like?

Here are small examples for Ruby and JavaScript:



Address_Book_MainWindow ={:type => "MainWindow", :unnamed => "1", :visible => "1", :windowTitle =>"Address*Book")})
Address_Book_New_QToolButton ={:text => "New", :type => "QToolButton", :unnamed => "1", :visible => "1", :window => Address_Book_MainWindow})


def main


Code completion


gui.addressBookMainWindow = new ObjectName({type: "MainWindow", unnamed: 1, visible: 1, windowTitle: "Address Book"});
gui.addressBookNewQToolButton = new ObjectName({text: "New", type: "QToolButton", unnamed: 1, visible: 1, window: gui.addressBookMainWindow});


function main() {

Comparison to string-based Object Map

So far the Object Map repository contained a string-based mapping of Symbolic Names to Real Names. An example: the Symbolic Name

:Address Book - Add.Forename:_Label

gets resolved to the Real Name

{container=':Address Book - Add_Window' text='Forename:' type='Label'}

All names are just plain and fixed strings however. In case the text of the label is dynamic and changes over time the map quickly fills up with new entries. The Object Map Editor supports editing of names and properties. Including usage of wildcards and regular expressions. Or dropping of unstable properties and outdated names. Still, maintenance of such a list can become cumbersome. Through tighter integration with the script language testers can make use of its features like parametrization.

Further Details

For a more detailed description on how this works and advantages of the new approach, please read the two original blog articles Improved Management Of Object Names and Improved Management Of Object Names Part 2.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copy link
Powered by Social Snap