When to use extract
Use an extract step when your test needs to remember a value from one page and use it on another. Common scenarios include:- Cross-page validation — You’re on a product listing page (PLP) and want to capture a product name and price, then verify those same values appear correctly on the product detail page (PDP) and again at checkout.
- Capturing generated data — Your application creates something new (an order confirmation number, a ticket ID, a username) and you need that value in a later step or a dependent test.
- Dynamic content — The data changes on every run (timestamps, generated emails, randomized content), so you can’t hardcode it in your test.
How extract reads the page
How Extract finds a value depends on whether your test runs in a browser or in a native mobile app.Web
On web runs in Chrome, Edge, Firefox, and Safari, Extract reads the live page over a few rounds, not only the screenshot. It can capture:- Content anywhere on the page, including content below the fold, hidden or off-screen content, iframes, and shadow DOM
- Element attributes, such as a link’s
href, an input’s value,alttext, ordata-*attributes - Computed styles, such as a color as hex, a font size, or an element’s size
- A network response, when the description names the request or API
Native mobile
On native mobile runs, Extract reads only the screenshot, in a single pass. It captures what is currently visible on the page and storesNot found for a missing value instead of failing the step. Add the extract step at the point in your test where the value you need is on screen.
Extract only reads the page. If the value is behind a tab, a collapsed section, or a dialog, open the tab, expand the section, or dismiss the dialog in the step before the extract step.
How to add an extract step
1
Open the step menu
Type 
extract in the step input, or use / and choose Extract a value.
2
Configure the extraction
Enter a Variable Name and an Extraction Description that tells Spur exactly what to capture from the page. You can extract up to 5 variables in a single extract step.To use a scenario value in the description, type 
[ and choose a property from your scenario table. For example, Price of [Product_name]. When the test runs, Spur replaces the property with the value from each scenario row.
3
Save the step
Click Save Step. The step now shows the variable name it will extract.

4
Use the variable in later steps
In any subsequent step, type 
{ to open the variable menu and select your extracted variable.

Example: Validate product data across pages
A common e-commerce test needs to verify that a product’s name and price stay consistent from the listing page, through the detail page, and into the cart. Here’s how to build that with extract steps:1
Extract the product name on the PLP
On the product listing page, add an extract step to capture the product name into a variable called
PRODUCT.2
Click into the product
Use the extracted variable to click on the correct product:
Click on {PRODUCT}.3
Extract the price on the PDP
Now on the product detail page, add another extract step to capture the price into a variable called
PRICE.4
Add to cart and verify
Click Add to cart, then add a verify step to confirm the cart shows the correct product name and price using your extracted variables.

PRODUCT and PRICE variables — no need to extract again.
Example: Capture a confirmation number for a dependent test
When your application generates data (like an order confirmation number), you can extract it and pass it to a future step or a dependent test:- Complete the flow that generates the data (e.g., place an order).
- Add an extract step to capture the confirmation number into a variable like
order_id. - In a later step, reference
{order_id}to look up or verify the order.
Generating random emails
You can generate random email addresses directly in your test steps using natural language. This is useful for sign-up flows, form submissions, or any scenario that requires a unique email each time. In a Type step, describe the email format you want. For example:abcdefghij@testdomain.com on each run. To reuse this email later in your test, add an Extract step right after to save it as a variable.
Accessing extracted variables in JavaScript
You can access extracted variables in JavaScript steps using thewindow.env or env object:
Email_address, you can reference it in a JavaScript step as window.env.Email_address or env.Email_address.
More examples
Form validation — verify error messages
Form validation — verify error messages
Extract an error message into a variable, then verify it matches the expected text. Useful when error wording is dynamic or locale-dependent.

Dynamic data — capture multiple values at once
Dynamic data — capture multiple values at once
Extract multiple values (like a count and a timestamp) in a single extract step, then use both in a verify step.

