Popups are a common part of the user experience, but they sometimes present challenges for automated tests, particularly if they appear at unpredictable moments. To ensure your browser tests run smoothly, it's important to understand how mabl handles different types of popups:
- Browser dialogs - these system-level popups aren't part of the web page's HTML. mabl manages these automatically using a built-in feature called automatic popup dismissal.
- In-app popups - these popups are part of the web page's HTML, so the mabl Trainer can record steps to interact with them. mabl also uses automatic popup dismissal to clear unexpected in-app popups that block target elements during cloud runs.
Read on to learn more about working with popups in mabl.
Browser dialogs
Browser dialogs include basic auth popups, browser permission popups, and window prompts, such as window.alert(), window.confirm(), and window.prompt(). The Trainer automatically dismisses these types of popups during training and execution.
Example of a browser dialog
Browser dialogs are not part of the webpage's HTML. For this reason, the mabl Trainer cannot capture interactions with browser dialogs.
- Basic auth: see the article on basic auth for more information on how to test applications that use basic auth popups.
- Browser permission popups: during training, local runs, and cloud runs, the browser is configured as if the user had already allowed requests for information from the user, including geolocation and notification popups. For geolocation popups, coordinates are automatically set to the data center where the browser is being executed.
- Window prompts: During training, local runs, and cloud runs, mabl automatically dismisses window prompts, such as window.alert(), window.confirm(), and window.prompt().
Automatic popup dismissal in action
In-app popups
In-app popups are elements that appear over elements on the page. Modals, tooltips, or dropdown navigation are all examples of in-app popups. Because in-app popups are part of the webpage's HTML, the Trainer can record and execute steps to interact with them.
Example of an in-app popup
During cloud runs, if a step interacts with an element that is blocked by another element, such as a modal or dropdown, mabl identifies the blocking element as a popup and attempts to dismiss it using automatic popup dismissal. This behavior helps prevent flaky tests when in-app popups appear unexpectedly.
Note
Automatic popup dismissal cannot be disabled.