Overview
Spur uses an AI agent to interact with your web application the same way a human tester would. The agent sees the page, reads visible text, and performs actions based on your instructions. The key shift from traditional QA is moving from selector-based testing to intent-based testing. Instead of writing brittle locators tied to implementation details, you describe what you want the agent to do in plain English.Write each step as though you are instructing a colleague who is looking at the screen.
- Use plain English
- Do not include code, CSS selectors, XPath, or DOM attributes
- Describe elements by what a user can see, not by how they are built
General guidelines
These guidelines apply across all step types — action, verify, and extract.Keep the viewport in mind
Page layouts differ between desktop and mobile viewports. Elements may appear in different positions, behind menus, or require different scroll distances. If your test runs on both viewports, confirm that each step works on both.Ensure content is visible
The action and verify agents can only interact with or observe elements that are currently visible on screen. Before any action or verification, make sure the target content is in view. If it requires scrolling, clicking, or expanding a section to appear, perform those interactions first as separate steps. On web runs, extract steps read the whole page. See Writing extract steps.Writing action steps
The action agent performs user interactions on the page: clicking, typing, scrolling, hovering, selecting, and waiting.Intent-based prompting
Describe what you want to happen, not how to do it. Focus on the intent and the stable, visible parts of the element.One goal per step
Give each step one goal. Related fields on the same form can share a step, which also speeds up the test. Keep actions and checks in separate steps (see Separate actions from verifications).Scrolling
The agent only interacts with elements that are currently visible in the viewport. If the element you need is off-screen, include an explicit scroll step.Writing verify steps
The verification agent is a visual assertion agent. It looks at the current state of the page and checks whether your assertion is true. It does not perform any interactions.Separate actions from verifications
Wrong
Verify that when you click on the button it changes color to greenThe verify agent cannot click — this will fail.
Correct
Step 1: Click on the buttonStep 2: Verify that the button is greenAction and verification are separate steps.
Be assertive and clear
Write definitive assertions. Avoid ambiguous or conditional phrasing.Wrong
Verify if the delivery details section is there or notCheck whether the checkout button appears on the pageWords like “if” and “whether” create ambiguity — the agent doesn’t know what outcome to expect.
Correct
Verify that the delivery details section is presentVerify that the checkout button is visibleClear and assertive — the agent knows the expected state.
Multiple assertions
You can perform multiple assertions in a single verify step when checking related things on the same page state.Avoid asserting ephemeral content
Do not verify elements that appear and disappear quickly, such as toast notifications or loading spinners. These are unreliable because the agent may capture the page state after the element has already disappeared.Writing extract steps
Extract steps capture data from the page and save it as a variable for use in later steps.Know how your browser reads the page
On web runs in Chrome, Edge, Firefox, and Safari, Extract reads the whole live page, not only what is on screen. It can capture content below the fold, hidden or off-screen content, element attributes, computed styles, and network responses named in the description. Unlike action and verify steps, Extract descriptions on web runs can name DOM attributes such ashref. It can also derive values, such as a count or a yes or no answer, and counts “the Nth” item over the whole page.
On native mobile runs, Extract reads only the current screenshot. Make sure the content you want is visible before the extract step on these runs.
Ensure the browser is in the right state
Extract only reads the page. If the data appears only after an interaction, such as clicking a tab, expanding a section, or dismissing a dialog, perform that action before the extract step.Multiple extractions in a single step
Extract up to 5 variables in one step to speed up your tests. For more details, see the full Extract step reference.Browser interactions
The action agent cannot interact with the browser directly — it cannot open new tabs, switch between tabs, or look at other tabs that are open in the session. For these operations, use dedicated Browser Action steps.Open New Tab
Open a URL in a new tab while keeping the current page
Redirect
Navigate the current tab to a different URL
Refresh
Reload the current page
API requests with JavaScript
For scenarios that require API calls — such as seeding test data, resetting state, or verifying backend responses — use a JavaScript step with a fetch request.Best practices
Keep tests short and focused
Keep tests short and focused
Each test should verify a single user flow or feature. Short tests are easier to debug when they fail and faster to re-run. If a test is getting long, consider splitting it into smaller, independent tests.
Handle popups and modals first
Handle popups and modals first
If your application displays popups, cookie banners, or modals on load, dismiss them in the first step of your test to ensure a clean starting state.
Validate early and often
Validate early and often
Add verify steps after critical actions to catch issues early. This also establishes checkpoints that make failures easier to diagnose.
Extract only what you need
Extract only what you need
Only extract data you will reference in subsequent steps. Unnecessary extractions slow down tests and add maintenance overhead.
Use JavaScript as a backup
Use JavaScript as a backup
When standard action, verify, or browser action steps cannot handle a scenario, use JavaScript. But prefer plain-language steps when possible — they are easier to read and maintain.
Quick reference
Copy-and-paste templates for common web testing flows.Dismiss popups and search
Form submission
Add to cart and checkout
Next steps
- Read the Mobile Prompting Guide for mobile-specific instructions
- Browse the Prompt Library for ready-to-use prompt patterns
- Review Common Pitfalls for detailed examples of mistakes to avoid
