Aswathy V S
Aswathy V S

Reputation: 1

How to save each iterations xml request to one file and add a header and footer

I am using Jmeter to create 100 records xml file. I will have 100 order id (unique) in this xml. I want a header and footer for this 100 order id like below: header Order1.... Order2... Order3... footer

But while running my script I'm getting like header Order1... footer header Order2... footer header Order3... footer

I'm using a loop controller in my script and a ctx function in a Beanshell listener as attached. Can someone help me to understand what am I doing wrong

I tried using the ctx function .its helping to get the request. but each time header and footer get append with each order

Upvotes: 0

Views: 47

Answers (1)

Dmitri T
Dmitri T

Reputation: 168157

We cannot provide a comprehensive answer without seeing your at least partial (better full) response and your Beanshell code.

So far I can only provide the following recommendations:

  1. If you're writing into the same .xml file with more than one thread it's better to use Flexible File Writer
  2. Since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting so consider migrating.

Upvotes: 0

Related Questions