Skip to content

← All questions

Chaining a created id into a UI assertion: JSON path $.id is undefined in the last response

Asked 10,140 views3 answers

Trying to seed through the API and assert in the browser, which is the whole reason we picked this thing.

gherkin
@hybrid @regression
Scenario: A seeded order appears in the list
  When I seed via POST "/orders" with body:
    """json
    { "sku": "SD-1", "qty": 2 }
    """
  And I save the response JSON path "id" as "orderId"
  And I navigate to the "orders" page
  Then order "{{orderId}}" should show status "Pending"
text
JSON path $.id is undefined in the last response; cannot save as {{orderId}}.

The endpoint definitely returns an id, I checked with curl.

asked by Bea Lindqvist4,318 ·

3 answers

Have the same question?

Ask it with the command you ran and the output you got, and it will be answered here.

Ask a question

Related