WebServices LoadTesting Using Jmeter - Part 2

In Previous post we mentioned that “In case there is change in the XML we need to modify the SOAP/XML-RPC Request everytime.”

Also, if in case we want to create some different orders with different prefixes then we need to add different threads and in that case if the xml is changed, we need to modify the xml in all the Xmls.

We can overcome such situations by keeping the xml at a location which can be accessed by the thread when ran. Only one xml can be modified for any changes without updating them on each request.
Let’s proceed with the steps

  1. The xml is saved at certain location with name as “order.xml”
  2. Add a “Once Only Controller” to the Thread Group. Add a BeanShell sampler to the controller.
  3. Simple code in BeanShell sampler to read the required xml as below:
Readxml
The above step read the order.xml and stored it in OrderXML.
We wrote a function readxmlFile which can be used to read any xml file and store for further modifications.
4. Add another “BeanShell Sampler” to the Thread Group for parameterizing the xml.
5. The code for modification is as below:
Note: The variables in the xml as modified  for e.g.  #LOCATION_ID# instead of ${ LOCATION_ID} as in previous posts.
XML Mod6. In the SOAP/XML-RPC Request, just mention the XML as parameter as below:
SOAPReq
We will have the overall TestPlan as below:
Testplan

Comments

Popular posts from this blog

How to use a value between two different threads in Jmeter

Steps to Analyze AWR Report in Oracle

Correlation and checking in Results