How to check the file name using controller in JMeter?



  • I have 125 thread group in my JMeter test plan. Now i have to run my test in master slave method with 5 slaves. But i have to run only first 25 thread group in 1 slave. Example: Slave-1 - Thread group 1 to 25 Slave-2 - Thread group 26 to 50 --- Slave-5 - Thread group 100 to 125

    Now i will place my CSV data file accordingly.Means file 1 to 25 in slave and so on.But when i click run option all the 125 threads will start in all slave.
    So i have to validate the file name using If controller and if it exist it should run in that slave or else it should run.

    Kindly provide your logic by using the if controller in jmeter. Any suggestion will be great help.



  • You can use following in your IF Controller to check if the file exists

    ${__groovy(((new File("/Users/hansi/Documents/training/jmeter/install/apache-jmeter-5.3/bin/jmeter.sh")).exists()))}
    


Suggested Topics

  • 2
  • 3
  • 2
  • 3
  • 2