How can I launch a specific "thread group" in a JMeter test plan from the command line?

How can I launch a specific group of threads in a test plan from the command line? I have a test plan (project file) that contains two "thread groups": one for crawling a site and the other for invoking specific URLs with parameters. From the command line that I am running with Maven like this:

mvn.bat -Dnamescsv = src / test / resources / RandomLastNames.csv -Ddomainhost = stgweb.domain.com -Dcrawlerthreads = 2 -Dcrawlerloopcount = 10 -Dsearchthreads = 5 -Dsearchloopcount = 5 -Dresultscsv = Jmeter cleanResults.csv

I want to pass an argument to run only one of the two "thread groups" in this project file. Can you do it with JMeter? I don't want to use an IF controller unless I have to, because that sounds like a "hack". I know SoapUI allows you to do this with the "-s" option.

I asked this question on the JMeter forum .

+3


source to share


1 answer


We use the while controller in our tests. It doesn't look like it to me, it works well. With JMeter properties, you can easily enable and disable thread groups. Please note: you cannot change your status if the test is already running.

  • Add While controller - $ {__ P (threadActive)}
  • Set JMeter property to JMeter load (-JthreadActive = true)
  • Launch test


Note that $ {__ P (threadActive)} is equal to $ {__ P (threadActive)} == true, nothing but true will cause the thread group not to start

+2


source







All Articles