Skip to content

Tabs, dialogs and downloads

Some clicks do more than change the page: they open a new tab, download a file or show a browser dialog. This page shows how to tell Allgreen what to expect.

Every Click step has a setting called What the click does:

  • Nothing more: the usual case.
  • Opens a new tab (the next steps happen there): for a link that opens in a new tab or window.
  • Downloads a file: for a button or link that downloads something.

Choose Opens a new tab (the next steps happen there). Allgreen waits for the new tab, and all the next steps happen in it. The step reads, for example: Click the “Terms” link, which opens a new tab.

If no tab opens, the step fails with “The click did not open a new tab.”

When you are done in the new tab, add the step Go back to the first tab. The next steps happen again in the tab the plan started in. The new tab stays open.

Choose Downloads a file. You can also fill Its name contains (optional), for example invoice or .pdf, to check the file’s name. The step reads, for example: Click the “Download” button and download a file whose name contains “.pdf”.

  • If nothing is downloaded, the step fails with “The click did not download a file.”
  • If the name does not match, it fails with a message that gives the real name.

The downloaded file is kept in the report: open the run and look under Screenshots and files downloaded, where each file says on which browser and device it was downloaded.

A browser dialog is the small window a site opens with alert, confirm or prompt: “Are you sure?”, “Enter your name”, “Saved!”. It is not part of the page, so you cannot click it like a button.

Add the step Answer the next dialog before the click that shows the dialog. Choose how to Answer:

  • Accept (OK), and if the dialog asks a question, the Text to type (optional).
  • Dismiss (Cancel).

The step reads, for example: At the next dialog, accept, answering “Paris”.

To check what the dialog said, add a check after it: Check the page, then its last dialog in What is checked. Fill Its message contains with a part of the message. The step reads: Verify that the last dialog’s message contains “Are you sure”.

If no dialog showed, or its message was different, the step fails and says what the dialog said.

Some parts of a page come from another site and sit in a frame inside the page: a payment form, a map, a video, a chat window. To act on an element there, open the element’s Where is it? setting and choose In an embedded frame, by its title or In an embedded frame, by its position.

The guide on elements explains how to recognize elements, frames included.