Working in the test case editor
This guide starts where Your first test in under 30 minutes stops. It explains what each part of the editor does, from cleaning up a recording to the advanced step settings. Every button and label below is written exactly as it appears in the dashboard.
A test case is built from what you recorded. Locus never asks you to invent a step or a check for something you did not record. If the same flow can end in two different ways (a success page or an error banner), record each outcome as its own test case.
1. Before you start
- A new recording is a draft. Drafts do not run. You review the test, save it and press Mark ready.
- The editor keeps nothing until you press Save Definition. While you have edits that are not saved, the header says Unsaved changes. After a save it says Saved for a few seconds. If you try to leave with unsaved edits, the editor asks first.
- Every save creates a new version of the test case.
- An archived test case opens read-only. The editor says "This test case is archived and currently read-only. Unarchive to enable editing."
Important: the editor does not show whether the test case is a draft or ready. If you save an edit on a test case that was ready, it goes back to draft, and the only message is a Saved toast. The Mark ready button appearing again is your cue. Press it again when you are done editing.
2. The screen
The step list is on one side. The other side has five tabs for the step you selected:
| Tab | What it is for |
|---|---|
| Step | The step's action, how it handles failure, and the value it types or selects |
| Locators | How Locus finds the element on the page |
| Observed outcomes | What the page did after the step during recording, which you can turn into checks |
| Network | The requests the step caused, response checks and values to pass to later steps |
| Assertions & waits | The checks on this step and the waits before them |
3. Basics: clean up a recording
On each step row you can:
- Rename it (the button titled "Rename step").
- Disable it. A disabled step is excluded and never runs. Press Enable to include it again.
- Copy it (the button titled "Duplicate step").
- Move step up or Move step down.
- Restore its original recorded values ("Restore original step values from recorded baseline").
Use Filter steps to search by name, action or target.
Why a recorded step has no Delete button. The step list shows Delete step only for steps you added yourself. A recorded step is kept as evidence of what happened. To remove it from the run, disable it.
The review queue
Some steps are flagged. The step row shows a Review badge, and the editor lists them under Needs review (N). A step is flagged when Locus found too few reliable ways to target its element, or when its value was masked at capture (a password, for example). A test case cannot be marked ready while an enabled step still needs review. Disabled steps are never asked about.
The queue groups steps by the reason they were flagged:
- Accept this, or Accept all N for a whole group, records that you looked at the step and are happy with it.
- Disable this removes the step from the run instead.
- A group called Needs your decision holds steps that cannot be accepted in bulk. A recorded password step lands here. Open each one and decide.
Example from a real recording of a login and settings flow: the queue showed "2 steps need review", one group headed "only 2 independent strategies (no stable_attribute locator could be built)" with Accept all 1, and one Needs your decision group holding the password step.
The Needs review (N) button above the list filters the list down to those steps.
4. Make a step reliable
Open the Locators tab. The Locator Inspector lists every way Locus knows to find the element. The Viable Strategies tile counts the different kinds of locator that are switched on.
The rule. A target needs three different kinds of locator switched on, or two when:
- one of them is a unique, stable id; or
- one is a unique role-and-name locator whose name is trustworthy, plus a real backup.
A trustworthy name is at least three characters long, contains at least one letter (in any language) and is not just the role or tag repeated. A real backup is a unique stable-attribute locator, or a unique relational locator whose expression does not use the same name. A backup built from the same name breaks the moment the wording changes, so it does not count.
With two, both must be semantic, stable-attribute or relational locators. CSS and XPath locators count toward the three but not toward the two, so a stable id plus a CSS locator still shows a warning. Switching a locator off asks for a reason. The tile updates at once (for example to 1 with <3 (Warning)), but the step is not flagged yet: the header says Unsaved changes. The flag is set when you press Save Definition. After the save the step shows Needs review and the tab says "Needs Review: only 1 viable strategies (3 needed)".
A repeated element: Position pick
When many elements look the same (rows in a list, for example), you can pick one by its position. Position pick shows the consequences first and asks you to tick that you understand them. The panel warns that if the list is sorted differently or the data changes, another item can be picked.
A custom locator
Custom QA Locator lets you add one locator of your own for a step that has a recorded target. Use Add Custom Locator, Edit Custom Locator or remove it. It forces the step to Custom (Needs Review). It does not heal itself when the page changes, and a notice says so. After you check it, the step shows Custom Verified.
5. Give a step its data
For a step that types or selects, open the Step tab. Input Value Source offers:
- Recorded: what you typed during recording. It is turned off when the value was masked.
- Static Text: a value you type in.
- Secret Reference: a saved secret, such as a test password. The value is never shown again after it is saved.
- Variable: a variable of the test case.
- Generated: a generated value. This option appears only on steps that fill a field.
For where secrets and environment-specific names come from, see the first guide.
6. Prove something happened
A check proves something. A test with no checks only proves that the steps could be performed (Passed, no checks).
There are two ways to add a check:
- Attached to a step. Open the step's Assertions & waits tab, press + Add assertion, choose what to check and press Add Assertion. A check attached to a step runs right after that step's action and its waits finish.
- As its own step. The Add step menu also offers checks, which then run as steps of their own.
The checks are grouped by what they read:
| Group | What it reads |
|---|---|
| The page | The whole page: text that appears, the page address (URL), the page title. These work for toasts, banners, new rows and navigation. |
| Network and console | What the page sent or logged. These never depend on an element. |
| An element | One element: the step's own element, or another one you point at. |
A wait pauses until something is true, and an assertion fails the run when something is not true. The wording differs, for example Wait for text to appear on the page against Text appears on the page. Choose a wait when the thing needs time to show up.
Two timeouts exist and they are different. The form for a check has its own Timeout (ms). A step that is itself a wait or an assertion has a Timeout (ms) on the Step tab, which shows 30000 when nothing is set (the allowed range is 100 to 120000).
Observed outcomes
This tab lists what the page did after the step during recording. Use Promote to assertion on one to make a check from it. Some observations cannot be promoted. The button is disabled and a sentence says why.
Network
This tab lists the requests the step caused. Use Assert HTTP Response to check one. You can also pass a value from a response to later steps by adding an extraction rule and switching on its export. If a step caused no requests, the tab says No Network Requests.
A replay never sends these requests itself. The page sends them when the step runs, and Locus checks the response the page gets. If a check fails with a 400, the page sent different data than it did in the recording (for example an empty or changed field), so open the request body and compare. If a request is missing from the step, use Missing a request? Attach one from the recording; do not try to build one.
7. Advanced
- Failure Policy. What the run does when this step fails. Stop ends the run and marks the remaining steps skipped. Skip records the failure and carries on with the next step; the run still ends as failed. Retry if safe tries the step once more, but only when Idempotent Action is also on; otherwise it behaves like Stop. Pause is meant for a person to look at the page, but a replay on the server has nobody to resume it, so there it ends the run like Stop. If you have never touched this, leave it alone: it is a per-step safety net, and the usual reason to change it is to Skip a step whose failure should not matter (an optional cookie banner, for example).
- Idempotent Action. Tick it when doing the step twice is harmless (opening a menu, typing into a field). It has no effect on its own. It only lets Retry if safe repeat the step. Do not tick it for a step that creates, pays or deletes something, because a retry would do it again.
- Native Dialogs (browser prompts). Some pages open the browser's own alert, confirm or prompt box. The recorder notes how you answered, and the replay answers the same way. In the card, Add dialog response lets you change an answer (Accept, Dismiss, or text for a prompt). Answers apply in the order the dialogs appear while this step runs. A dialog you do not list is accepted (OK). Most tests never need this; open it only if a step's run fails or behaves differently because a dialog was answered wrongly.
- Variables. The Variables panel adds a variable with a Variable Name and a Default Value. You can remove a variable, but you cannot edit its default in place. To change it, remove the variable and add it again.
- Files to upload. A step that sets an input file shows a Files to upload card where you pick a file from the site's library.
- Missed events. Events recorded but not attached to any step can be attached to one. This saves a new version straight away, so save your other edits first. It will not run while you have unsaved edits.
- A step fails with "Element hidden" (menus that open on hover). Some menus only open while the mouse is over another element, and Locus does not record hovering. During replay the menu item is then hidden and its step fails as Element hidden. To fix it, open the failed run and press Add hover step under the error. Pick the step whose element opens the menu. Locus adds a hover on that element just before the failed step, in your draft. Save Definition to keep it. The button only appears for this one failure, on the run page, not in the editor.
8. Finish
- Press Save Definition.
- Press Mark ready.
- If a step still needs review, Locus refuses. The editor shows a message headed Save Failed that reads "steps still need review; resolve them before marking the test case ready". The message does not name the steps. The test case page, on the other hand, shows Mark Ready Blocked with the names of the flagged steps. Open the Needs review (N) filter in the editor to find them.
9. Troubleshooting
| What you see | What it means |
|---|---|
| Version Conflict | The test case was updated in another session or re-normalized. Press Reload latest version to review and apply your changes again. |
| Validation failed: N issue(s) found in definition | The definition has fields that are not valid. Fix the steps it lists. |
| An Invalid badge on a step | That step has a validation error (its tooltip reads "Validation error on this step"). |
| Save Failed under Mark ready | Steps still need review. See section 8. |
| A step cannot be deleted | It was recorded. Disable it instead. See section 3. |
| Mark ready button is back after a save | Saving returned the test case to draft. Press Mark ready again. |