Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Jmeter JSR223 sample doesn't create second xml file on second iteration

I am trying to read an xml file, update values and save as new file to upload in each iteration But when I run with 2 iteration the JSR223 sampler doesn’t create second xml . please help. My

The request doesnt fail for the second iteration it just doesn’t create a new xml file .

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

We are not telepathic enough to guess what’s wrong without seeing your code so please get familiarized with How do I ask a good question? SO documentation chapter

Blind shot: you’re using a JMeter Function or a Variable directly in your assertion code. Given you have Cache compiled script if available box checked JMeter will resolve the value only once and cache it for the future use. So basically the assertion runs twice but it overwrites the file on 2nd iteration so you have the data from 2nd (or whatever is the last iteration) only.

So if you have a JMeter Variable in your script either use vars shorthand or put it to "Parameters" section. The same applies to JMeter Functions.

Like instead of ${foo} use vars.get('foo') or do something like this:

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading