Skip to main content
Reads a value from the page and writes it to the test’s env map. When schema is set, the returned value must validate against it or the step fails.

Parameters

ParameterTypeRequiredDescription
goalstringYesNatural-language description of the value to extract.
schemaobjectNoJSON Schema the extracted value must validate against.
iframestringNoURL or URL pattern of the iframe that contains the target element.
saveAsstringNoName of the variable to write this step’s return value to.
retriesnumberNoNumber of times to retry the step on failure before failing the test.
skippedbooleanNoSkip this step at execution time.

Shorthand

Pair with saveAs to capture the value into env.
- extract: the order id shown in the confirmation banner

Examples

- extract:
    goal: the main heading text shown on the page
    saveAs: EXTRACTED_HEADING
- extract:
    goal: The discounted subtotal in the order summary
    schema:
      type: object
      properties:
        amount:
          type: number
      required: [amount]
    saveAs: ORDER
- extract:
    goal: the company name shown on the YC profile page
    iframe: https://www.ycombinator.com/companies
    saveAs: COMPANY_NAME