Web Services Functional Testing

Web Services Functional 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 incorrect responses can lead to problems. Web Service Functional Testing ensures that your web service is functionally correct. Automated Web Service Functional Testing involves carrying set of tasks automatically and comparing the result of same with the expected output and ability to repeat same set of tasks multiple times with different data input and same level of accuracy. Implementing functional test for your web service early in the software development cycle speeds up development, improves quality and reduces risks towards the end of the cycle.

Following document will help you understand how you can successfully implement Functional Testing for your Web Services using AppPerfect.

Automated Functional Testing of Web Services with AppPerfect

AppPerfect offers Web Service Functional Testing solution in the form of AppPerfect Web Test. AppPerfect Web Test Supports functional testing for web services using SOAP protocol.

Creating Test Scripts for Web Services Functional Testing :

  1. Creating new project is an easy one step process. Just start AppPerfect Web Test product and select File -> New.. menu option to create a New Functional 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.
  2. Web 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 Web application Functional Testing. We will need to add new group for Web Services Functional 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 functional test.

    Web Services Functional Testing : Adding Action Group

Adding Tasks to Web Services Group:

  1. 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 Web 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.

    Web Services Functional Testing : Add Task Option
  2. 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.

    Web Services Functional Testing : Add Web Services Task
  3. 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.

    Web Services Functional Testing : Editor View

Extensive Validation and Custom Scripting support :

AppPerfect's Web Service Functional 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.

  1. 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 Functional 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.

    Web Services Functional Testing : Validations
  2. Custom Validation Support : For any Functional 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 JavaScript 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.

    Web Services Functional Testing : Script Editor

Extensive support for Parameterization :

AppPerfect's Web Services Functional Testing solution supports extensive support for test parameterization, wherein you can configure each iteration to run with different data set. 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.

  1. 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.

    Web Services Functional Testing : Test Parameterization
  2. 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 Functional test your web service with multiple iterations as per your requirement. AppPerfect generates extensive reports for each iteration and task. To replay the test select the Project -> Run.. menu option. AppPerfect will execute the SOAP tasks in automated manner. At the end of test execution you can view the detailed results for each of the SOAP task 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 Running a Soap Test and Viewing Results chapter.

Web Services Functional Testing : Results

Conclusion :

Its practically impossible for a human tester to repetitively cover all the test cases with same amount of accuracy over and over again. AppPerfect's Web Services Functional testing Solution has ability to perform complex set of tasks repetitively with same amount of accuracy every time which makes it both cost effective and reliable solution for functional testing.
Once a SOAP test is created 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 created can be reused and extended to cover more features and test cases as your web service evolves,
AppPerfect's Web Service Functional testing solution is platform independent. Functional Tests recorded on one platform can be used to play back over different operating systems and hardware configuration. AppPerfect Web Test is found to be most affordable, cost effective, efficient, reliable and accurate Functional Testing solution by its customers. In case you have not yet tried AppPerfect Web Test, Download Now and give it a try today.

Library z-lib
We use cookies for analytics, advertising and to improve our site. By continuing to use our site, you accept to our Privacy policy and allow us to store cookies.