Kamiccola
Kamiccola

Reputation: 53

How to set up a test in jmeter with reusable configuration?

I have a lot of test plans that use the same config set up and I've been looking into how to make the set up reusable instead of having to copy and paste it between the many test plans.

Examples of what I'd like to reuse:

  1. Set up all HTTP config defaults that I have stored in:
  1. Set up getting the test data stored in CSV Data Set Config (for example, one test plan has 7 of these). I should mention, the HTTP defaults are set up with variables that rely on the CSV data so I need this set up to be dynamic.

I tried to save them as Test Fragments, but that doesn't seem to work for config elements, only for code. Maybe there's a way to code this set up somehow?

  1. User Defined Variables config element where each variable's value is a script that runs at runtime (I use these for various date manipulations). I haven't tried to save the variables as a test fragment yet, but ideally, I would just add it to each of the master config Test Fragments if I had those to reduce how many elements need to be imported to the test.

How does everyone else do it? Copy and paste of so many config elements is difficult to manage. For example, I'm in the middle of a major overhaul due to application version change and all http defaults need to be updated, which means I have to go to every test plan to fix it in, and I have about 30 of them. I dream of a day when I can just update it in one place.

For the record, I'm using jmeter 5.6.3 with no plugins. (If it's possible to achieve without plugins, I'd prefer that solution since I can't use plugin manager due to security, but if that's the only way, let me know which plugin it is so I can make a case to enable it).

Upvotes: 0

Views: 33

Answers (1)

Ivan G
Ivan G

Reputation: 2707

It's possible to build test plans using JMeter Java (or Kotlin) API so it's possible to update existing test plans as well or generate "skeleton" from Java or Kotlin code.

It's also possible to get the code for your current test plan from the context menu:

enter image description here

More information:

Upvotes: 0

Related Questions