0
votes

I have the following test plan i Jmeter:

  • Thread group
    • User params
    • Csv DataSource
    • While controller
      • Once only controler
        • http sampler
      • http sampler
        • RegEx extractor (Finds the variable that is the condition in the while loop)
    • If controller
      • Http sampler
      • Save response to file
    • BeanShell Post Processor (Cleans up used variables)

Now, my issue is, when the If controller's condition is met, after the thread is done, it loops as expected. But, when the If controller's condition is not met, after the thread is done, the run stops, and no loop occurs.

In the thread group settings i have "Loop = 50" and "Action on Error: Start next thread loops"

In the system's log, there are no errors at all.

Any ideas?

1

1 Answers

1
votes

If the condition is not met the If Controller's children will not be executed and you will not see them in the jtl results file.

If you add i.e. a Dummy Sampler after the If Controller you will see that the Dummy Sampler will be executed 50x times per each virtual user.

Some more recommendations:

  1. Since JMeter 3.1 you should be using JSR223 Test Elements and Groovy language for scripting
  2. According to JMeter Scoping Rules your BeanShell Post Processor will be executed after each sampler, I don't know what exactly it is doing but currently it's being executed after each Sampler so might be the case it's cleaning the variable you're using in While or If Controller.