Recording and scheduling scenarios
A scenario can be recorded: do it yourself in the profile’s window, and what you do becomes its lines. It - and a warm-up - can run on a schedule.
On this page
Recording
- Open Scenarios (⇧⌘E) and choose or make a scenario.
- At the bottom choose the Profile and press Record. A stopped profile is started with a window.
- Do in the profile’s window what is to be repeated: open pages, click, type, press Enter. The editor’s foot shows “Recording · steps: N”.
- Press Stop Recording. What was recorded is added to the scenario’s end, where it can be changed. In a new scenario that still holds the example, it takes the example’s place.
Each step is an ordinary line of a scenario:
await page.goto('https://shop.example/login');
await page.type('#email', 'alice@example.com');
await page.type('input[name="password"]', params.password || ''); // a password is not recorded
await page.click('text=Sign in');
await page.waitForLoadState();A page that opens within 5 seconds of a click or Enter becomes one line that waits for it to load. Where a field already held text, the recording selects it and types the new text - as you did. A recording ends when its profile stops, with the lines it has.
How elements are found
The recording picks what does not change from one load to the next, in this order:
- an
idthat is unique on the page and does not look made for this load only; data-testidand the like, attributes made for tests;name,aria-label,placeholder,title;- for a link or a button, its text, when exactly one element has it;
- only when there is none of these, the path from the nearest element that can be named.
The password
What is typed into a password’s field is never recorded: the page does not send its text, and the profile’s process drops it even if it came. The line has params.password - write the password in its place, or pass it as a parameter when the run is started through the API.
What is not recorded
- embedded frames, dragging, file uploads, hovering;
- a choice in a drop-down list - it goes into the scenario as a comment;
- a warm-up’s pages and the profile check’s measuring page: only what you do in a window you see is recorded.
Schedule
Schedule is at the bottom left of the Scenarios window, and On a Schedule…, beside Run, schedules the scenario that is open. Press Add and choose:
- What to run - a scenario or the profile’s warm-up (by the warm-up plan chosen for the profile);
- the Profile;
- When - Every day at a time or Every few hours;
- Random shift - none, ±5, ±15, ±30 or ±60 minutes. Each run moves by a random time within it, so that runs do not fall on the same minute.
A schedule’s row shows its next run and how the last one went; its switch turns it on and off.
When a schedule runs
- Only while Lumen is open and the vault is unlocked: it does not wake the Mac or start the app.
- A run missed by more than 6 hours is not made; it waits for the next time.
- If the profile is busy then - starting, being checked or running a scenario - the run moves on by 10 minutes.
- Schedules are kept on this Mac, in the vault, and are not synced.
Recording and schedules are part of automation: they are in Professional and Team, not in Personal. In a plan without automation saved schedules do not run; they can be switched off or deleted.
Found a mistake, or is something missing? Write to us.