Overview

AI Extract allow you to pull information from the page and save it into variables for later use. This is particularly useful for working with dynamic data that you need to reference in subsequent steps.

Key Benefits

  • Dynamic Data Handling: Capture and store changing values from the page
  • Natural Language Extraction: Describe what you want to extract in plain English
  • Reusable Values: Use extracted data in later validations, inputs, or instructions

Usage

The extract step requires two main components:

  1. A description of what to extract
  2. The variable name to store the result
"extract": "Get the price of the first item in the search results",
"variable": "itemPrice"

Common Use Cases

Price Comparison

// Extract the price from product page
"extract": "Get the item price shown on the product page",
"variable": "productPrice"

// Later, verify the same price in cart
"assertion": "Verify that the item price in cart matches $productPrice$"

Order Information

// Save order number after purchase
"extract": "Get the order number from the confirmation message",
"variable": "orderNum"

// Use in later steps
"instruction": "Search for order $orderNum$ in the order history"

Best Practices

  1. Be Specific: Clearly describe what to extract
// Good
"extract": "Get the total price including tax from the order summary"
   
// Avoid
"extract": "Get the price"
  1. Use Descriptive Variable Names: Choose names that indicate the stored value
// Good
"variable": "productPrice"

// Avoid
"variable": "value1"
  1. Extract One Value at a Time: Keep extractions focused and single-purpose
// Good
"extract": "Get the shipping cost"
   
// Avoid
"extract": "Get the subtotal, tax, and shipping cost"