1

I am using jmeter for load testing so I am a little bit stuck at this situation. Below is the scenario.

There are two HTTPS (target1 and target2) requests which needed to be generated sequentially in jmeter.

ID value from response to target1 request is needed in target2. Said ID is valid only once.

What I tried was:

Take the ID from the first request each time individually and send it in the target2 request by increasing the Threads only not the loop count because ID won't work for the second time.

Is there any other way we can do perf test for this, because I need to test at least 5K-7.5K users

Thank you in advance!!!

0

You can try and adding JSR223 PostProcessor.

The script will look like this: vars.put("response", prev.getResponseDataAsString());

but response that you get might be quite a lot. Since you only need the ID, then try adding Regular Expression Extractor too.

Then the "response" variable can be access as ${response} and you can pass it on your targeted https2.

| improve this answer | |
0

JMeter always executes requests in sequential order. Retrieve the ID in first request by using Regular Expression Extractor and try to print in second request by using Beanshell PostProcessor.

| improve this answer | |
0

What's the problem with increasing the number of loops? If you hit the target1 second time it will produce the new ID, won't it? So the previous JMeter Variable holding the previous ID will be overwritten with the new ID so you will be able to hit the target2 normally.

It also shouldn't be a problem to simulate 5-7k of virtual users from a mid-range modern laptop, just make sure to follow JMeter Best Practices, if one machine is not enough you can always go for running JMeter in distributed mode

| improve this answer | |
0

Put the requests in Critical Section Controller (under Logic Controller) according to your desired order.

| improve this answer | |
  • 1
    This might be technically correct, but it still leaves the OP with the real problem: automatically retrieving the required ID parameter from the first response and inserting it into the second request. – Kate Paulk Jun 26 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.