0
votes

Can somebody please explain me how can I use JMeter for Feature testing?

I'm able to create multiple HTTP requests within a Testplan. But I need know the way to capture the previous API response and pass one of the response data to the next API request.

Eg: 1.Create Account. Request- POST: /account Response: ID: "Value"

  1. Read account Request- GET: /account/
1

1 Answers

1
votes

JMeter is really more of a load testing tool, and best used as such. Capturing data from responses is possible using the Regular Expression Extractor, which can store extracted values in variables for use in a subsequent request. It is a bit of a pain in the ass to use, though.

On your request, add a Regular Expression Extractor:

Field to check: body
Reference name: EXAMPLE
Regular Expression: \[.*\] #your regex here, stuff in square brackets as example
Match No.: 1

In a subsequent request, you can then use the variables defined by the extractor, e.g. ${EXAMPLE_g0} for the entire match, or ${EXAMPLE_g1} for group 1, etc.