Use response body in the next senario
See original GitHub issueIf I have a scenario like this:
Scenario: get a list of all categories
When method get
Then status 200
And match response == '#array'
! And def first = response[0] <-- Define the first element of the response array as 'first'
Scenario: get details about the first category
Given path first.id
When status 200
And match response == read('firstCategory.json')
Questions:
- Is something possible
- If yes, how 😃 ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Using response data from one scenario to another
Make a GET request to specific data; Store a value as a def variable; Use that information for a separate scenario. This is...
Read more >How to Read Json Response Body using Rest Assured?
Using these methods we can get an Object of type io.restassured.response.ResponseBody. This class represents the Body of a received Response.
Read more >Extracting Data from Responses and Chaining Requests
You're getting the response as a string in `responseBody` variable and it is not attached to the document for you to be able...
Read more >how to log entire response (at least statusCode & body) #650
I'm trying to correlate the response statusCode with the response body. How can I get a log of the body & the statusCode?...
Read more >Simulating Stateful Behavior for Testing - WireMock
Stub mappings can be configured to match on scenario state, such that stub A can be returned initially, then stub B once the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ptrthomas thank you very much, it works now, but I have to put the preparation scenario in an other feature. 👍
To summarize, there are 2 different way:
I’m thinking about such a tag, like
#karate-test
or#karate-rest-test
, or simply#karate
.Thanks for your help and for the amazing framework 😃
Great ! BTW I was thinking of the tag name as #karate-dsl