jmetertest-plan

Is there a way to define UDVs and defaults in only one test-plan and then "load" that JMX in other test plans?


Suppose I have a large API I want to test and let's say I am using JMeter as the test tool.

(You could argue that JMeter is best for load/performance testing and that, instead, I should code the tests myself.)

All tests will have in common certain UDVs, the JDBC configuration, and HTTP Request Defaults, and perhaps also HTTP headers.

I want to control which tests I run.

One option given on SO is to put all tests into one big test plan file, then to set the threads or iterations to a JMeter property with default value of 0, so that on the command-line, you just need to set the property to some non-zero value to run the test you want.

I want to consider the option of having test-plan1 in one file test-plan2 in another, etc.

If I did that, it seems I would have to copy-paste the UDVs, JDBC config, defaults, and so on into each test plan. Is this right, or is there a way of "including" these components from a single test plan in multiple test plans?


Solution

  • There is no option to include UDV from one test plan into another test plan, however you can have UDV, HTTP Header Manager, etc. defined in the "main" test plan and include the Samplers for different tests stored as Test Fragments from "other" test plans via Module Controller