Performance test scenarios are not like the automated test scenarios. While automated test scripts focus on a few functionalities, performance test scenarios might be focused on more functionalities.
There might be some unexpected conditions in your scenarios and you have to take the necessary actions. To deal with them effectively it is advised that you add decision points in your scripts.
Apache JMeter allows you to create decision points in your test scripts.
First of all, you need to analyze the response and take an action to it.
This in this example, we have used a CSS Extractor. It will fetch values in your HTML via [data-name=’brand’] expression. Then it will find this web element’s data-href attribute and assign it to the brandLink variable. In case there are no results, the variable will be set to noBrand.
performance test
Now you have a test plan as follows. In case If Brand Controller returns True, a new request will be executed. If it’s set to False, it won’t make any more requests.
performance test
By having an If-Else condition you will enrich your test plans.
Please feel free to ask questions if you have any.
Happy load testing…
Originally published at loadium.com on February 13, 2018.