jmeter Simulating AJAX with Jmeter

  • perf-test.com need your contributions to build up a strong repository of performance engineering resources.

dpakbhaskar

New Member
Aug 19, 2014
2
0
1
Simulating AJAX with Jmeter. This article is a extension to an existing article by Deepak Shetty.

Few pointer before I proceed:
1. We are not trying to execute Javascript using Jmeter
2. We are not simulating actual browser AJAX behavior.
3. What we are trying here is to simulate the parallel calls (eg. JSON) made inside the Javascript using Jmeter

Issues with Jmeter:
1. Jmeter does not have built-in mechanism to support parallel executing requests. Requests inside a thread group will be executed sequentially.
2. Jmeter does not have a built-in mechanism for data sharing across thread groups. Yes data can be shared across threadgroups via Properties, but if multiple threads are changing the value of the same property, there lies the issue.
3. Beanshell code was not able to set the Cookies using Cookies manager.
4,. Beanshell code was able to set the Headers using Header Manager, but was setting it properly.

Overcoming the issues:
1. This is implemented as explained by Deepak Shetty.
2. Setting a property actually did not work for me, there were multiple threads all changing a single value is not recommended. And i had a combination of 2 values, if the combination changes, the requests were failing. I had use variable which were specific to the threads. The variable had the thread_id appended to them.
3. Had to use Cookies Manager and replace the Beanshell variable there
4. Same as above.

-Deepak