Introduction

Dialogs are popup windows that appear in your browser to ask for user confirmation or input. They can be triggered by JavaScript functions like:

  • window.confirm() - Shows a confirmation dialog with OK/Cancel buttons
  • window.prompt() - Shows an input dialog where users can enter text
  • window.alert() - Shows an alert message with an OK button
Native dialog example

How to handle dialogs in Magic Inspector

By default, Magic Inspector will automatically dismiss any dialog that appears during test execution. However, you can change this behavior for specific actions.

To configure how dialogs are handled:

  1. Open the options of the action that will trigger the dialog
  2. Look for the "On dialog" section
  3. Choose between "Accept" or "Dismiss" using the radio buttons
  4. Run your test normally
Dialog behavior options in action settings Native dialog example

For dialog with prompt

Additionaly, you can use the "Optional prompted value" input (shown as 2 in the above figure) to enter a specific value for the prompt dialog. This field is optional.

Default behavior

By default, Magic Inspector will automatically dismiss any dialog that appears during test execution.

Was this page helpful?