How to handle application alerts
This example demonstrates how to handle a browser alert.
In the solution shown below, you will see that the browser alert in Worksoft SaaS Training application is handled using "assertAlert" command. You will need to provide the text present on the alert in the target field.
Solution:
# | Command | Target | Value |
---|---|---|---|
Handle the browser alert | |||
1 | assertAlert | I am a JS Alert. |
Tips, Tricks, Gotcha's & Best Practices:
- As an alternative, you are encouraged to use verifyAlert or waitForAlert commands to handle alerts.
- As a best practice, you can use assertAlertPresent, waitForAlertPresent, assertAlertNotPresent or waitForAlertNotPresent commands to check the presence of the alert before using "assertAlert" command.