JavaScript dialogs in Squish for Web (alerts, confirmations)

Last edited on

Squish will not record clicks on alert or confirmation dialogs, although it will record a call to the closeConfirm() function for confirmation dialogs.

Squish for Web cannot interact with such dialogs itself, hence it avoids showing them at all when replaying the script.

There is no useful interaction possible with alert dialogs (other than clicking the OK button) so Squish simply hides them (and clicks the button).

For confirmation dialogs Squish waits for the test script to execute the closeConfirm() function which takes a parameter indicating whether the OK or Cancel button is to be considered to have been clicked.

The functions lastAlertText() and lastConfirmText() can be used to query the text from alert and confirmation dialogs.