Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been trying to find a way to mass generate jmeter xml config files based on my template and some variables I could define somewhere.

Bash didn't work too well, I was trying while read line with sed but the actual jmeter template I generated has too many parseable characters that it seems to get unsustainable.

Ideally I would like to find a solution that takes the template and a list of parameters as input and generate files. The only real thing that would be changing would be the target url.

On the second (optional) phase would be to find a way to loop through the parameter file to add multiple target url's. The targets are just simple xml blocks and just need to be added in order.

Template goes something like this. I've excluded several hundred lines of empty parameters and most of the tags. It has 2 TESTURLPATHs but it would be nice to add more dynamically if the parameters file had multiple url's to test. But just to demonstrate:

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.3" jmeter="2.8 r1393162">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="PLANNAME" enabled="true">
.
.
.
<stringProp name="HTTPSampler.domain">TARGETIP</stringProp>
<stringProp name="LoopController.loops">NUMLOOPS</stringProp>
<hashTree>
 <HTTPSamplerProxy ... >
  <stringProp name="HTTPSampler.path">TESTURLPATH</stringProp>
 </HTTPSamplerProxy>
 <HTTPSamplerProxy ... >
  <stringProp name="HTTPSampler.path">TESTURLPATH</stringProp>
 </HTTPSamplerProxy>
<hashTree>
</hashTree>
</hashTree>
</jmeterTestPlan>
share|improve this question
2  
This seems more like the kind of thing that is a better fit for Stack Overflow. –  Iain Nov 14 '12 at 8:51
    
true true... moving :) –  sty Nov 14 '12 at 9:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.