XView Convenience API
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:
This function activates the menu item with the specified itemText in the menu identified by the given objectName.
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, etc.) 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.
This function closes the currently open notice (if one is open) using the specified button so that it returns the specified result.
This function finds and returns a reference to a panel item given its fully qualified name itemName.
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.
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.
Important: The AUT Must be Running
installEventHandler function will only work if it is called after the AUT has been started (e.g., using the ApplicationContext startApplication(autName) function).
This function returns a true value if a notice is currently open; otherwise it returns a false value.
This function returns the text of the last opened message.
This function opens (shows) the frame called frame.
This function sends an event of type eventName to the 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:
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
This function uninstalls an event handler that has been previously installed using installEventHandler(eventName, handlerFunctionNameOrReference).
© 2022 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.