Objects in HTML pages can also be identified using their DOM paths.
Getting an Object’s DOM path¶
To get a DOM path for an object one of the following methods can be used.
Launch the application from inside Squish and make sure the relevant object is visible. Then click Squish’s Application Object view’s Pick toolbar button and then click the object in the application. (You may need to right-click rather than left click to avoid unintentionally activating the item or following a link.) This method is particularly useful for objects that don’t normally have multi-property names (such as items in a table).
Obtain a reference to the object in the usual way, i.e., by calling the
waitForObject() function with the object’s symbolic or real (multi-property) name, and then call the
hierarchicalQualifiedName() method on the object. This method returns the DOM path. For example:
You can also use these commands in the Squish IDE’s script console where they will print out the object’s DOM path in the test log view: you can then copy it from there.