Handle dialog
Answers the page's alert, confirm and prompt dialogs for you.
Only in
WarpX Browser
Handle dialog decides in advance how the page's JavaScript dialogs are answered: OK or Cancel, and what to type into a prompt. Run it on the page before the click that opens the dialog. Without it, WarpX Browser dismisses every dialog, as if you had pressed Cancel.
Settings
- Accept dialog
On: alerts are closed, confirm dialogs answer OK, and prompts answer with Prompt text (optional). Off: confirm dialogs answer Cancel and prompts return nothing.
ExampleChecked- Prompt text (optional)when Accept dialog is on
The text to answer a prompt dialog with. You can use references such as
{{variables.confirmWord}}. Do not use double quotes in it.Exampleyes- Delay time (ms)
A pause after the block, in milliseconds, such as
1000. Or a range such as1000,3000for a random pause each run.Example0
Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.
What it hands on
Leaves by its only output. It writes nothing.
Example: Delete a saved address that asks you to type yes
- Open URL
- Handle dialog
- Click element
- Element exists
- Add Open URL with
https://shop.example.com/account/addresses. - Add Handle dialog. Tick Accept dialog and type
yesin Prompt text (optional). - Add Click element on
button.delete-address. The site's prompt asks you to type yes, and the block answers it. - Add Element exists on
.address-deletedto check the address is gone.
Good to know
- The block only affects the page that is open when it runs. After the page navigates, or in another tab, add Handle dialog again before the next dialog.
- It changes
alert,confirmandpromptin the page itself. It does not reach dialogs raised inside an iframe, or pages whose security policy blocks inline scripts. Those dialogs are dismissed as usual. - It does not answer the leave-page prompt (
onbeforeunload). While WarpX Browser drives the profile's browser, that prompt is accepted automatically.
See also
- Click element — Click an element on the page, with human-like mouse movement by default.
- JavaScript code — Run your own JavaScript in the page, and pass data back to the workflow.
- Element exists — Check whether an element is on the page and continue by one of two outputs.