I have a JMeter script that contains many API Requests. What I want to do is execute some/all the APIs depending upon whether the user has provided true/false in properties file. If it is true for the API it should be executed otherwise not.
Properties file looks like this:
#############################API Executions
#Make sure to provide true if you want to execute the API otherwise false.
API1=true
API2=false
API3=true
JMeter Test Plan looks like this:
- Test Plan
* Thread Group
- If Controller1
* API1
- If Controller2
* API2
- If Controller3
* API3
Current approach that I am following is checking for every API via an If Controller
${__groovy("${__P(API1)}" == "true")}
But this approach does not look good to me, as I need to include an If Controller with every API Request.
Is there any better approach for this problem?