Jmeter - generate xml

I have a J2EE application that requires some advanced integration testing. I use Jmeter to generate HTTP POST requests. So far, I manage to send them to the server correctly, but the xml is static. I am looking for a way to insert dynamic / random values โ€‹โ€‹into XML and then send it to the server. Something like PreProcessor, but I'm not sure how this is done.

Can anyone provide:
1. JMeter tutorials?
2. How to create dynamic / random xml content for an HTTP request
3. JMeter Examples

Many thanks,
Gadi.

+4
source share
3 answers

JMeter recommendations strongly recommend using pre-generated data in order to have good performance and accuracy.

The task can be completed through the CSV dataset configuration component ( Best Practices , Section 16.5). The main idea is to create a large set of test data, save it in a text file, and then use it as parameters in the request template (line of the CSV file for the request). You can put the entire query as one and only parameter, if you wish.

Please note that JMeter 2.3.4 (latest version of atm) has some limitations:

  • he does not understand multi-line values โ€‹โ€‹(although these are supported by the CSV standard itself), therefore, acceleration may be required;
  • he does not understand column names, so it is possible to map variables only by column position (unfortunately, not by logical name).

Thanks Maxim

+1
source

You can embed dynamic or random data in XML using the __Random and __char functions nested in XML.

So, every time xml is placed, the values โ€‹โ€‹will be random.

basically, just define your xml structure and use the __random and __char functions nested in each other to randomly create arbitrary text / numbers. Then use the __time function to generate date and time data.

+1
source

Another approach to testing your web application is to use automated recording tools, such as Badboy, to record the steps you want to test with your web application. Then you can pass the same script to Jmeter for testing purposes.

You can also pass different values โ€‹โ€‹to parameters in a script to test different scripts. For example, for your application there is a login page with a username / password field. Then you can write a script in case 1) and 2) invalid credentials.

Then, during testing, you can pass various values โ€‹โ€‹through CSV or by changing some values โ€‹โ€‹directly in the recorded script.

Further information on Badboy can be found at http://www.badboy.com.au/

0
source

Source: https://habr.com/ru/post/1301056/


All Articles