I have a Test Plan, that executes multiple Thread Groups consequtevly - But for one of these Thread Groups I want to be executed once and on next Test Plan exection it should be ommited. Is this possible?

2

There are 2 best solutions below

0
On BEST ANSWER

You can implement it as follows:

  1. Put all the requests in your Thread Group under the If Controller and use the following expression as the "Condition"

    ${__groovy(!new File('somefile').exists(),)}
    
  2. Add a JSR223 Sampler at the end of your Thread Group and put the following code into "Script" area:

    new File('somefile').createNewFile() 
    
    • If Controller checks for somefile file presence in JMeter's "bin" folder (or whatever is your current working directory) and if there is no file in it - its children will be executed.

    • JSR223 Sampler creates this somefile when it's being executed so next time you will run your test the condition will not be met and Thread Group will skip all its samplers. If you will need to re-enable the Thread Group - just delete this somefile

0
On

Not sure if I fully understood your requirement. If you would like to ignore a specific thread group dynamically , then you could pass the 'number of threads/users' for the thread group to 0 using properties.

more information is here - http://www.testautomationguru.com/jmeter-manage-test-plan/