XView Convenience API

Note: The XView Convenience API is only available for the Squish for XView editions.

Here are some quick links to the XView Convenience API's functions:

activateItem(objectName, itemText)

This function activates the menu item with the specified itemText in the menu identified by the given objectName.

clickItem(object, x, y, state, button, action)

This function sends a mouse click at position x and y in the object item's coordinates to the panel item (such as a button, choice item, and so on) with the button button, modifier state state and action action of the panel referenced by the object.


This function closes (hides) the frame called frame.

closeNotice(button, result)

This function closes the currently open notice (if one is open) using the specified button so that it returns the specified result.

Object findItem(itemName)

This function finds and returns a reference to a panel item given its fully qualified name itemName.

installEventHandler(eventName, handlerFunctionNameOrReference)

This function installs a global event handler. The script function named or referenced in handlerFunctionNameOrReference, will be called when an event of the eventName type occurs.

The eventName can be any of the following event types:

  • Crash occurs if the AUT crashes
  • NoticeOpened occurs when a notice window is opened
  • Timeout occurs when the Squish response timeout is reached

The function name passed as the handlerFunctionName is called with a single argument—the object on which the event occurred.

Note: In Python scripts, you can specify the callback function to invoke by passing an actual function or a lambda function.

For examples see How to Use Event Handlers.

Note: The installEventHandler function will only work if it is called after the AUT has been started. For example, by using the ApplicationContext startApplication(autName) function).

Boolean isNoticeOpen()

This function returns a true value if a notice is currently open; otherwise it returns a false value.

String lastNoticeMessage()

This function returns the text of the last opened message.


This function opens (shows) the frame called frame.

sendEvent(eventName, receiverObjectOrName, ...)

This function sends an event of type eventName to receiverObjectOrName (i.e., to the given object or to the object identified by the given name). Any additional arguments are used to initialize the event that is sent (e.g., coordinates, button states, etc.).

The following eventNames are supported:

  • "ButtonEvent"
  • "KeyEvent"
  • "WindowEvent"
  • "ResizeEvent"
  • "DestroyEvent"

type(object, text)

This function sends key events to the editable panel item object to enter the given text as if the user had typed the text at the keyboard. The input is case-sensitive, so type(object, "R") is different from type(object, "r").

uninstallEventHandler(eventName, handlerFunctionNameOrReference)

This function uninstalls an event handler that has been previously installed using installEventHandler(eventName, handlerFunctionNameOrReference).

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.