-1

I have 2 APIs.

  1. Post api to insert data and return unique identifier.
  2. Get api to get inserted data with unique identifier got for first post api.

I have created 2 scenarios. But 2nd scenario not working because I'm not getting actual unique identifier from 1st scenario.

How can I make these two scenarios dependant.

1 Answers1

0

the gatling documentation covers this well - you're after the section on checks.

So for each request you can store a part of the response in a session variable using

.check(
  jsonPath("$.someJsonPath").saveAs("id")
)

after this, whatever was at '.jsonPath' in the response will now be in the session under the key 'id'.

you can then use this with the gatling DSL methods - for example

.get("myurl/${id}")
James Warr
  • 2,552
  • 2
  • 7
  • 20