Akshay
Akshay

Reputation: 669

running all http request at one time in Jmeter

enter image description here

In my test plan after login i am clicking on link, that link makes call to 10+ different services to show data. With current test plan all those 10+ service goes in sequential format i wan't know if there is a way i can call all of them at same time. I can create multiple thread to achieve this, but as i have more links to add and it will create more thread and more login instance. Just wanted to get suggestions if i can do something using logical controllers available in Jmeter?

Upvotes: 3

Views: 4721

Answers (2)

vins
vins

Reputation: 15400

As per the design, JMeter does not support sending multiple HTTP calls at the same time for a single user. It will send them sequentially only! So, you might not be able to simulate AJAX requests exactly as the browser does.

However JMeter has Beanshell sampler / JSR223 sampler through which you can implement that yourself.

See this example.

The approach might be ok for few threads/users. When i tried to follow similar approach for more than 20 threads, I got an Out of Memory error for a very simple test as it has to create multiple threads to simulate AJAX calls for each user.

Upvotes: 3

timbre timbre
timbre timbre

Reputation: 13995

Unfortunately each thread always runs sequentially (the only exception is retrieval of embedded resources in HTTP sampler, but this is now useful in your case). There are a few options:

  1. Use multiple threads with Random Order Controller or Random Controller

  2. Use Thread Groups running on parallel. And in order to not duplicate your code in each thread group, use Module Controller

  3. I saw jmeter-parellarel-request, but I have no experience with it, so cannot recommend

Upvotes: 3

Related Questions