Search code examples
jmeter

jmeter: Include controllers and Azure


I have a login component that I want to reuse between different thread groups. Initially, I moved it to a separate include controller, which allowed me to reuse the code locally.

However, the problem is that Azure Cloud (we're bound to it) does not support JMeter scripts with included components. I was trying to make commands that just copy the controller code into thread groups before uploading it, but the approach seems to be quite error-prone (as I have to copy some chunks of text that are sometimes changing).

I wonder if there is another way to merge IncludeController into the thread groups using some plugins. Or is there another way of solving it?


Solution

  • As per documentation

    You can upload additional JMeter configuration files or other files that you reference in the JMX file.

    so my expectation is that you can upload a separate .jmx test script which contains the Test Fragment with your "login" components and reference it in the Include Controller using only its filename.

    If this doesn't work you should rather report it as it's kind of violation of DRY principle.

    Alternatively you can embed the test fragment into the .jmx script and reference it using Module Controller but this way it won't be possible to re-use it across different .jmx test plans and you will have to support it in multiple places somehow, maybe via version control system modularization capabilities or generate the fragment on the fly somewhere in setUp Thread Group using JSR223 Test Elements like here or here