0
votes

In jmeter: I’m using two http requests in one thread group, so I’m getting two response from those http requests. I need ‘member id’ from one response and some string(digest) from other response, in order to create third http request.

I have extracted 'member id' by using this regular expression: {"Id":(.+?)} which return me correct member id.

Response from 2nd request is string(digest) : "G9V6Su9PESaobcInErdD7Y8OKNo=" I added one more regular expression to extract this string : "(.+?)"

I have added two debug sampler as I'm using two regular expression extractor.

then I pass extracted values 'member id' and string(digest) as a parameter to third http request.

When I run it I'm getting error, my 3rd http request failed. It's failing to pass extracted 'member ID', but its correctly pass string(digest)

In first debug sampler: its showing correct extracted 'Member ID' but some different values for digest field.

In 2nd debug sampler: its showing correct extracted 'digest' field but some different value for 'Member ID'. I’m doing it all under one thread group

I'm new to jmeter, I don’t know whether it is possible to extract field from two different response and use as parameter to create new http request. if it possible how to do it please help me.

Thanks in advance.

1

1 Answers

0
votes

I believe that it's due to including quotation marks (and who knows what else) into the "Id" regular expression, you need to surround it with quotes like:

{"Id":"(.+?)"}

Also the better way of working with JSON data is JSON Path Extractor which is available via JMeter Plugins project. See Using the XPath Extractor in JMeter guide (scroll down to "Parsing JSON") for more information on installation, usage, syntax, etc.