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?
JMeter - In Test Plan that executes consequtive Thread Groups - How to execute particular Thread Group only once
153 views Asked by Nelly At
2
There are 2 answers
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/
You can implement it as follows:
Put all the requests in your Thread Group under the If Controller and use the following expression as the "Condition"
Add a JSR223 Sampler at the end of your Thread Group and put the following code into "Script" area:
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 thissomefile