1
votes

I am trying to built a test plan in jmeter where i want to run test for specific HTTP request based on their names. I used if controller but I dont know what condition to write.

I am writing ${__samplerName()}=="HTTPRequestName" in the condition but it isn't executing. kindly help me as soon as possible.

1
Can you show us the full, failing block of code?leo
Its not even starting the execution. can you please tell me how to write the condition in If controller?MAK

1 Answers

6
votes

You need to surround ${__samplerName()} with quotation marks as follows:

"${__samplerName()}"=="HTTPRequestName"

See How to use JMeter's 'IF' Controller and get Pie. guide for more details on If Controller use cases and clauses.

In case if you need to run samplers basing on some condition, you can use JMeter Properties as follows:

  1. Launch JMeter providing sampler name property like jmeter -Jrunsomesampler=true
  2. Add If Controller with the following condition: ${__P(runsomesampler,)} == true
  3. Add desired HTTP Requests as a children of the IF Controller

If Controller