In the action logic, you can handle browser alerts using commands listed below. Browser alerts prevent access to the elements on the page. So, it is important to handle alerts in your test logic to unblock interaction.
Note: Some times, it may take a few seconds before an alert dialog appears on the screen. Insert a few seconds (about 5 sec) wait time before using one of the commands below.
Handle Alert Dialog | Handles browser alert dialog either by clicking Accept or Reject. |
Click a Web Element and handle Alert | Clicks a given element on the screen, and conditionally accepts /dismiss any alert that may have popped up based on the alert action selected. This is suitable in case the alert is only conditionally displayed based on the environment or other conditions. |
Wait for Browser Alert Message | Test execution waits up to a maximum of a given number of seconds for a Browser Alert/Prompt to appear. |
Get Browser Alert Message | Reads the message displayed in the alert dialog. |
Verify Browser Alert Message | Verifies if the message displayed on the alert dialog is as expected. |
Is Browser Alert Message | Used for conditional validations. Returns true/false depending on a matching alert message. |
Enter text in Browser Alert and confirm |
Enters given text in a Browser Alert and click on button to confirm. |
Comments
0 comments
Please sign in to leave a comment.