installEventHandler
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 the name of any of the following event types:
AlertOpened
– occurs when an alert box would be shown by the JavaScriptwindow.alert
functionBodyUnloaded
– occurs when the Squish the browser loads a new page or reloads the current page. This event is also sent out for any frames or iframes that Squish was able to hook when they load or reload their content. The handler function receives two parameters. The first parameter is the Squishcontext
name of the window or frame that changes. The second parameter is thelocation
URL of the content that is being unloaded by the browser.ConfirmOpened
– occurs when a confirmation (OK/Cancel) box would be shown by the JavaScriptwindow.confirm
functionCrash
– occurs if the AUT crashesModalDialogOpened
– occurs when a modal dialog is opened with the Internet Explorer-specific JavaScriptshowModalDialog
functionModelessDialogOpened
– occurs when a modeless dialog is opened with the Internet Explorer-specific JavaScriptshowModelessDialog
functionPromptOpened
– occurs when a prompt box would be shown by the JavaScriptwindow.prompt
functionTimeout
– occurs when the Squish response timeout is reachedWindowOpened
– occurs when a new window is opened by the JavaScriptwindow.open
function
The function named in handlerFunctionName
is called (with no arguments) whenever one of the registered events occurs.
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.
© 2024 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.