Extractions
Guide to extracting and reusing data in Spur tests
Extractions in Spur allow you to capture data from your application and reuse it in subsequent test steps. This is particularly useful for dynamic data that needs to be validated or used later in your test flow.
Type 'Extract'
Begin by typing “Extract” to open the extraction interface
Pre-extraction Setup
Fill in the required fields for extraction:
-
Specify what to extract
-
Define where to extract from
-
Set the variable name for future use
Run the Step
Execute the extraction step to capture the data
View Environment Variables
Check the extracted value in the environment variables section to confirm successful extraction
Use Extracted Value
To use the extracted value in subsequent steps:
Type `{` to open the dropdown of available variables
Select your variable from the dropdown to insert the extracted value
Common Testing Flows
Best Practices
-
Meaningful Variable Names
-
Use UPPERCASE for extracted or random variables
-
Use UNIQUE names for all variables
-
Choose descriptive names that indicate the data’s purpose
-
Example:
USER_EMAIL
,ORDER_TOTAL
,PRODUCT_ID
-
-
Extraction Timing
-
Extract data as soon as it becomes available
-
Verify the extracted data before using it
-
Consider adding waits before extraction if data is dynamic
-
-
Error Handling
- Add verfication after extraction
Troubleshooting
Common issues and solutions when working with extractions:
-
Data Not Found
-
Ensure the element is visible before extraction
-
Check if dynamic content has loaded
-
Verify selector accuracy
-
-
Invalid Data Format
-
Add verification steps after extraction
-
Use JavaScript for data cleaning if needed
-
adding wait steps for dynamic content
-
-
Variable Scope
-
Variables are available throughout the test
-
Use unique names to avoid conflicts
-
Consider prefixing variables for clarity
-
Next Steps
-
Learn about General Actions