Posts

Showing posts from August, 2015

WebServices LoadTesting Using Jmeter - Part 2

Image
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 The xml is saved at certain location with name as “order.xml” Add a “Once Only Controller” to the Thread Group. Add a BeanShell sampler to the controller. Simple code in BeanShell sampler to read the required xml as below: 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 Sam

WebServices LoadTesting Using Jmeter

Image
Before starting Jmeter Webservices testing we need to keep below information handy for : 1. XML/XMLs required for the flow 2. URL where the SOAP/XML-RPC Request Let us Create a new order using webservice: 1. Create a Test Plan 2. Add a Thread Group 3. Add Sampler -> SOAP/XML-RPC Request as shown below: SOAP/XML-RPC Request sampler sends a SOAP request to a webservice. It can also be used to send XML-RPC over HTTP. 4. Fill the required details in URL and SOAP/XML-RPC Data (XML) in the Request as shown below: In this XML we have some fields which are unique and need to be changed every time we send the request else it will fail as duplicate record as below: “There is an ongoing Customer Order with the same Customer Order ID” We will bring uniqueness to the record in 2 ways: 1.  Using the Data generated in a CSV file 2. Using a Beanshell sampler and change the Parameters in the xml Method 1: 1. We will create a CSV file with the required data