Web Service Testing Using Neoload
Join the DZone community and get the full member experience.
Join For FreeIn this tutorial, we will understand how to design SOAP and REST services using Neoload to validate the performance of web services.
Designing SOAP request in Neoload
Step 1: Create New Project (Go to File -> Click on New -> Enter Project Name -> Click Finish)
Step 2: Create New User Path (Right Click on User Paths ->Click on Create a User Path -> select New User Path -> Enter User Path Name )
Step 3: Create SOAP request inside Actions (Right click on Actions -> select Insert as child -> Select Request -> Select SOAP Request)
SOAP Request Wizard window will appear like below,
In two ways , we able to create SOAP request. Either by using WSDL file or by creating the SOAP request manually. Ensure you selected with option “Generate a Request within a WSDL File”.
Enter the WSDL url as http://www.dneonline.com/calculator.asmx?WSDL and click Next on SOAP Request Wizard.
Step 4: Select all the methods to call like below,
Click Next and Finish on SOAP Request Wizard.
We able to see all the methods added under Actions.
Now, we must select the method to Edit Call Parameters to provide inputs to the request. Simply click on Edit Call Parameters. Then, you'll see below screen where we can enter inputs.
Execute the request in a temporary user path by clicking on the Check button to validate request and response.
There is a different type of validation can be done by clicking on Validation button. Such as,
- Duration validation
- Content length validation
- Response content validation
Duration Validation is used to check expected response with actual response time in milliseconds.
Content Length Validation is used to check expected response content length with actual content length in bytes.
Response Content Validation is used to check expected response content with actual response content.
Designing a REST Request in Neoload:
Either we can create a new project or create New User Path to design a REST request. Here, we have demonstrated designing REST request in existing project using employee webservices, which is already available in web.
Employee URI is http://dummy.restapiexample.com/.
Here, we want to fetch all the employee details from employee service using GET method. Please follow the below steps to perform.
Step 1: Create New User Path (Right Click on User Paths ->Click on Create a User Path -> select New User Path -> Enter User Path Name )
Step 2: Add Http Request to add REST service (Right click on Actions -> Insert as child -> Request -> Http Request)
Simply execute your request in the temporary user path and validate the response.
Some of your web services required credentials to access the service. If so, then we have to mention the credentials under the servers component like below:
Define Scenario and populations under Runtime options to set Duration and Load Variation Policy.
Click Run to execute web services created in Neoload to calculate the performance of it. We will get Neoload performance report like below:
Opinions expressed by DZone contributors are their own.
Comments