Optional steps, hover, dialogs and uploads
Elements that appear only sometimes, menus that open under the mouse, browser dialogs and file uploads.
Optional steps
Some elements appear only sometimes: a cookie banner on the first visit, a promo popup, a newsletter prompt. A test that clicks them fails when they are missing. Make the step optional: if the element doesn’t appear in time, the step is skipped and the test continues.
- On the step card tick Optional and set the seconds to wait (default 3, up to 60). The card shows an OPTIONAL 3s badge.
- Available on clicks, typed fields, dropdowns, checkboxes, key presses, hovers and saved variables — not on a click that opens a new tab.
- When skipped, the Runner output shows
[optional] step skipped…. Manual Steps read Click on “Accept all” (optional: only if visible within 3s). - A variable saved by a skipped step is empty.
Hover: menus and tooltips
Mouse movement isn’t recorded, so a menu that opens only under the mouse needs a hover step:
- While recording, click Assert, then click the element that opens the menu (e.g. Products).
- In the dialog choose Interaction → Hover.
- Continue recording: move over the menu and click the entry you need.
The test moves the mouse over the element before clicking the menu entry. Manual Steps read Hover over “Products”. hover is also a verb for Page Object methods.
Browser dialogs: alert, confirm, prompt
Messages opened by the site with alert, confirm (“Are you sure?”) or prompt are recorded with your answer — OK or Cancel, or the text you entered. The test answers the same way instead of getting stuck. The dialog step is placed just before the action that opened it, because the test must be ready to answer before the dialog appears.
On the card you can:
- change the Answer: OK/Accept or Cancel/Dismiss (an alert only has OK);
- tick Check message to verify the dialog text too (a soft check);
- for a prompt, edit the text to enter, with dynamic data and variables from
{ }.
The built-in browser has no box to type a prompt answer, so a prompt is recorded with its default answer: set the text on the card. Manual Steps read Accept the next confirm dialog (“Delete item?”) and check its message or Answer the next prompt dialog (“Your name?”) with “Mario”.
File uploads
Choosing a file in an upload field is recorded as an Upload step. The file is copied into the project’s fixtures folder (up to 10 MB per file), so the test works on any PC and the file is included in the export. For a larger file only its name is recorded: choose the file again on the card.
On the card you can switch to:
- Choose… — another file from your PC (copied into
fixturestoo); - Generated PDF, PNG, text or CSV — a new file created at each run, when the content doesn’t matter.
An upload step can be optional. Manual Steps read Upload “cv.pdf” to “CV” or Upload a generated PDF file to “CV”.
Something unclear or missing? Write to info@actify-studio.com.