Picking and inspecting objects

Last edited on

Overview

Squish allows you to "pick" GUI objects of the currently running application. Once picked the following can be done with the object:

How to pick an object

Or, if you have a test script already:

Inspecting the GUI object tree

The objects listed in the Application Objects view can be expanded. The following work-flow describes convenient way to do this for a larger number of objects:

This work-flow can be used in conjunction with maximizing the Squish IDE window, and maximizing the Application Objects view (double-click on the title bar of the Application Objects view) inside of the Squish IDE window. The result looks similar to this:

Squish technical support may be asking you to provide a screenshot of such a maximized, expanded Application Objects view for review or analysis.

Inspecting child objects

The nodes in the Application Objects view can be expanded if the respective object has child objects.

After picking one only sees the node of the picked object in the Application Objects view. If the picked object has children it is possible to expand the node of the picked object.

Unpickable GUI objects - Moving up and down in the GUI object tree

Sometimes it is not possible or very hard to pick a desired object directly.

Solution #1:

Pick a parent object as close as possible to the desired object, and then expand one or more nodes in the Application Objects view until one finally arrives at the desired object.

Solution #2:

Pick a child object as close as possible to the desired objects, and then use the Up (arrow up icon) button in the Application Objects view to move the GUI object tree upwards until one finally arrives at the desired object:

How to pick menus and other volatile objects

In Squish for Windows, Qt & Java (AWT/Swing)

To pick menus and other volatile objects in Squish for Qt, Windows and Java (AWT/Swing - not SWT/Eclipse!) start picking and press and hold the Control/Ctrl key as long as you want to use the application. To pick, release the Control/Ctrl key and click on the object to be picked.

In other Squish editions

Approach #1 - Assign to variable and inspect properties in Variable view

import names

def main():
    startApplication("AddressBookSWT.jar")
    activateItem(waitForObjectItem(names.address_Book_Menu, "File"))
    activateItem(waitForObjectItem(names.file_Menu, "New..."))
test.py

...to...

import names

def main():
    startApplication("AddressBookSWT.jar")
    activateItem(waitForObjectItem(names.address_Book_Menu, "File"))
    o = waitForObjectItem(names.file_Menu, "New...")
    activateItem(waitForObjectItem(names.file_Menu, "New..."))
test.py

Approach #2 - Output all properties and values

Approach #3 - Look up object type and API of that object type

Object properties and methods

Notice that the Properties and Methods IDE views show the object's properties (with their current values) and the methods that can be called on the object.

Inserting verification points

If you want to insert a verification point you can do so now.

Inserting Property Verification Points

Inserting Screenshot Verification Points

Inserting Table Verification Points

Copying object names

If you want to make use of the object in a test script you can use the Application Object view's right-click context menu to copy the object's symbolic or real name to the clipboard ready to be pasted into your test script: