How to Run JMeter Samplers Defined Percentage: JMeter is used to create performance scripts that should behave similar to the real user during the load test.
In some scenarios like eCommerce or retail domain application, All the users who visit the application will not place the order.
If your scenario is like this
- Launching Page
- Login into application
- Going through menu items(selecting random menu item)
- Selecting a random product through a menu item
- Placing order
Now the requirement is to execute 4 transactions for 100% and last three transactions with 30% percentage
Let’s say if 100 users are visiting your application and only 30 users are completing their orders and the next 70 users just save their products or Items and not placing the order.
So if this needs to be a script in JMeter, we can create normal script as we create it if there is no condition to defined your samplers.
After creating the script we need to just add throughput controller for the requests or samplers for which need to limit the execution.
Below are the steps to use throughput controller
Right-click on Thread group–> Logic Controller -> Throughput Controller
Throughput has few options to configure
- Percentage executions
- Total executions
- The controller will execute a certain percentage of the iterations through the test plan.
- The controller will stop executing after a certain number of executions have occurred