Web Services Load Testing
A Web Service is a service accessed via Web. Web Service is a way to publish your application over web and enable other applications to access functions defined by your web service. Web services exposes an interface defined in Web Services Description Language (WSDL). Other applications can interact with Web service using the description provided using its WSDL interface. The protocol used to interact with Web Services is Simple Object Access Protocol (SOAP). SOAP is a simple XML-based protocol to let applications exchange information over HTTP.
Web Services with high response time and poor performance can lead to unsatisfied users. Web Service Load Testing helps in identifying the performance problems before you deploy your web service for end users. Web Services Load Testing helps you design and simulate usage traffic which can be used to test your Web Service infrastructure for performance, reliability and scalability. Load Testing of Web Services involves testing the performance and scalability of your Web Services with varying user load. Web Services Load testing involves simulating real-life user load for the target Web Services. It helps you determine how your Web Service behaves when multiple users hits it simultaneously.
Following document will help you understand how you can successfully implement Load Testing for your Web Services using AppPerfect.
Web Services Load Testing with AppPerfect
AppPerfect offers Web Service Load Testing solution in the form of AppPerfect Load Test. AppPerfect Load Test Supports load testing for web service using SOAP protocol.
Creating Test Scripts for Web Services Load Testing :
- Creating new project is an easy one step process. Just start AppPerfect Load Test product and select File -> New.. menu option to create a New Load Testing project. For details on New Project creation refer to Creating a New Project chapter. For details on configuring project properties refer to Setting Project Properties chapter.
- Load test script consists of a number of "Action Groups". A Action Group is a logical unit for combining actions
inside a test. By default the groups present are for HTTP Load Testing. We will need to add new group for Web Services Load Testing. To create a new Web Services Action Group just select Project Node in the Editor tree, and right click and select the option.Add Group... from the popup menu. Provide descriptive name for the group clearly stating what tasks this group is going to implement. Select the type of Action Group as SOAP defining the type of application you are trying to load test.
Adding Tasks to Web Services Group:
- Once you are done creating Web Services Group, you can add SOAP tasks to this group in form of web service operations. These web service tasks will be executed when you execute the Load Test. To add SOAP task, select the Web Services Group in the Editor tree. Right click and select the option to "Add Task.." from the popup menu. This will launch the Add Task dialog.
- In Add Task dialog provide WSDL File or URL. You can either browse though the WSDL file on disk or can provide the URL for WSDL. Once you have provided the WSDL, click on Load WSDL button. Application will parse the WSDL file and will show all the operations it exposes in the table below. Select the operations which you want to execute. AppPerfect will create a Task for each selected operation.
- Add all the required SOAP tasks by repeating the earlier steps. Once you are done adding all SOAP tasks you can browse though them in the Editor views and can parameterize or add required validations.
Extensive Validation and Custom Scripting support :
AppPerfect's Web Service Load Testing tool provide extensive support for validations. Once you are done adding SOAP tasks, you can edit your Test cases to perform required Validations on the response received as a result of SOAP task execution.
- Select the Validations node in the Project Editor and on right hand side you will find a button to Add Validation.... Click on that and it will launch a wizard to add validation. You can select to add validation for all the tasks in Test or can select any individual task and add validation for that. For details on Test Validations refer to Validations chapter.
Following kinds of validations are supported in AppPerfect's Web Services Load Testing solution:
- Fault validation : Select this option if you need to find if response contains SOAP fault. If response contains a SOAP fault, then the validation has failed.
- Element validation : Select this option if you need to validate value of a specific SOAP element in SOAP response.
- Text validation : To find if a particular text or value is present in the response or not you can use this validation.
- Date validation : Using this kind of validation you can compare the date value present in response against today's date in different formats.
- Database Query validation : Here you can validate if the result set returned as a result of query execution is valid or not.
- Custom Validation Support : For any Load Testing tool, one of the important criteria is support for customization. Apart from validations explained above, In case you need to perform any custom validation on Response you can do so using scripting. AppPerfect stores recorded test as java script and one can add custom code to the test script to perform any custom web or database validation. We support custom scripting apis, using which you can parse the response and fetch appropriate fields from the SOAP response and validate it against the required value. You can also use scripting apis to fire any database query and perform the required validation by fetching the required data using the result set. Script Editor can be invoked using Project -> Script Editor.. menu option. Please refer to Customizing Test Script chapter for more details.
Extensive support for Parameterization :
AppPerfect's Web Services Load Testing solution supports extensive support for test parameterization, wherein you can configure virtual users to run same script over and over again with different data set each time. AppPerfect offers extensive parameter-management. Parameter selection and testing with various parameter values is completely automated. Parameters are stored as name-value pairs, making it intuitive for application developers and testers. Then, depending on the number of iterations for your project, multiple parameter values can be tested, with options to select parameters sequentially or randomly. For more details on Test Parameterization refer to Parameters chapter.
- Select the Parameters Node in the Editor tree and on right hand side you will find button to add a New Test Parameter for your test. This will launch the Parameterization wizard which will help you creating and associating data source in your test. You can choose data source to be Fixed pool of values, Web Services, records in CSV file or can derive it from calculated values.
- Once you are done creating the Test Parameter you can associate same with SOAP Task Parameters, SOAP Headers or SOAP Attachments. Select the SOAP task which you need to parameterize and on right hand side you will find Parameters tab. You can parameterize the SOAP task parameter by clicking the Parameterize... button.
Test Execution with detailed Result Analysis :
Once the test is completely designed you can execute it to Load or stress test your web service with different load strategies as per your requirement. AppPerfect generates extensive reports for each virtual user and task. To replay the test select the Project -> Run.. menu option. AppPerfect will start specified virtual users simultaneously based on the selected Load Strategy. and each virtual user will execute the SOAP tasks in automated manner. At the end of test execution you can view the detailed results for each of the virtual user and export them to HTML, PDF etc. formats. In case of failure, you can pass on these exported reports to your development team for further analysis. For more details on Test Execution Results refer to Understanding Test Results chapter.
Web Services Load Testing helps you design and simulate usage traffic which can be used to test your web services application infrastructure for performance, reliability and scalability. Once a test case is recorded it can be played back multiple times with different data sets. Its possible to validate output with different data inputs using the same test case by parameterizing the user input. Moreover tests once recorded can be reused and extended to cover more features and test cases as your application evolves.
AppPerfect's Web Services Load Testing solution is platform independent. Web Services Load Tests recorded on one platform can be executed over different operating systems and hardware configuration. AppPerfect Load Test is found to be most affordable, cost effective, efficient, reliable and accurate Web Services Load Testing solution by its customers. In case you have not yet tried AppPerfect Load Test, Download Now and give it a try today.