Use API Step Data in Generate Scenario
You can use the response from your API steps as test data in your Gherkin scenario. This feature is especially useful when your test data is sourced from an API server and you need to leverage it for recording tests.
Load product data from an API response to dynamically verify product details in an e-commerce checkout test.
Note
Test data will only be available if you saved your API step using the Save API response as test data option.
Using API Step Data in Your Scenario
You can use API test data in your steps by referencing the API response fields using the step namespace.
Example
The API step Given get user API data
was saved with namespace user
gherkin
Scenario Outline: buy item
Given get user API data
Given login with "{{user.username}}" and "{{user.password}}
Next, use AI Generate Scenario to generate test automation code for the updated scenario. You can skip this step if you have already generated the code using AI Generate Scenario or Recorder.
During test runs, the test data will automatically vary based on the API step data, enabling dynamic and varied test execution.