Reputation: 11
I am using a Bean Shell sampler and a Bean shell preprocessor in my script. I want my Sampler to execute only when I get the value of a parameter defined in the preprocessor. Can anyone help me regarding this?
Upvotes: 1
Views: 2906
Reputation: 168197
You cannot enable or disable samplers in the runtime, basically you have 2 options:
Put your logic in the Beanshell Sampler inside if-then statement like:
if (someValue != null) {
//execute some code
}
So even if Beanshell Sampler will be executed - it will do nothing.
Upvotes: 2
Reputation: 129
Add HTTP request inside if controller, so that if value in parameter is same as value defined in preprocessor then only HTTP request will get executed
Upvotes: 1