closePrompt

closePrompt(":dummy", text)

This function is used to simulate the user typing some text into the dialog that JavaScript pops up in response to a prompt function call in a web page's JavaScript code. The first parameter must be a fake object name (e.g., ":dummy"); the text is the text that is normally entered into the prompt dialog's text edit.

Behind the scenes, when Squish tests a web application that executes a JavaScript prompt function call, instead of Squish allowing the dialog to pop up, Squish suppresses the dialog (if the browser allows this, otherwise the dialog will be automated), stops execution of the web application, and calls cancelPrompt() if replaying a cancel or the closePrompt function for an okay, passing the text that the tester entered when the test was recorded. Then Squish resumes the web application's execution, returning the text to the application as the prompt function call's return value.

See also cancelPrompt(), String lastPromptDefault(browserTab) and String lastPromptText(browserTab).

© 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.

Search Results