Blog Categories

Blog Archive

Web Services Test Automation - Challenges and Benefits

April 29 2016
Author: v2softadmin
Web Services Test Automation - Challenges & Benefits

Over the past decade, Service Oriented Architecture (SOA) adoption has increased significantly. SOA is essentially a collection of services that communicate with each other. This communication could either involve simple data transfer or it could involve two or more services coordinating some activity. These services are connected together by web services. The web services provide a standard means of interoperability between software applications running on a range of platforms and frameworks using XML, Simple Object Access Protocol (SOAP), Web Services Description Language (WSDL), and UDDI open standards over an internet protocol.

Service oriented architecture has great benefits. Test planning and test evaluation must be well architected while using SOA. Some of the challenges include:

  • Ensuring trustworthiness by simulating consumer roles for testing consumption of services and ensuring accuracy of results from interactions between individual and integrated services.
  • Dealing with complex test scenarios resulting from interfaces between heterogonous applications. Web Services are intrinsically distributed and are platform and language agnostic.
  • Handling security requirements such as authentication, access control, nonrepudiation, data integrity.
  • Considering performance and scalability as services could be consumed by multiple clients concurrently
  • Non-availability of code would mean incorporating Black or Grey box testing to test services
  • Increasing volume of regression testing
  • Identifying the right tools for testing
  • Define the test goal and decide which service functionality should be tested.
  • Generate the client or skeleton code for the web service
  • Preparing Data for testing
  • Define the required test inputs
  • Invoke the web service using the client or skeleton code
  • Call service methods and check results. Verify that the actual response is similar to that of the expected outcome

Functionality Testing entails verifying conformance of the service behavior against the given service design

  • The testing of mandatory and optional fields
  • Testing to verify the format and value of data fields such as date, currency, alpha-numeric, numeric and special characters
  • Testing to verify that correct value pair are supported by the service
  • Testing to verify enumeration where all values within a complete list is supported in that field

Integration Testingfocuses on the interactions between the services and interfaces to form a complete business transaction.

Integration testing can also be done by Web Service Mocking. It’s possible for us to start creating test for a Web Service the same time we start to develop the same Web Service. This means, when the real Web Service is ready for testing; we can already have the tests done. This can be extremely powerful and will make it possible to work according to Test Driven or Agile Methodologies.

  • Testing to ensure that services follow the correct workflow order
  • Message routing through the system including content based routing, data field mapping and transformation
  • System integration testing where the interactions between systems and interfaces are implemented as workflow

Given that web services are designed to be re-used and consumed by multiple clients, it is critical to understand the performance characteristics to ensure the scalability to be determined.

Performance testing is performed keeping in mind the following criteria:

  • What services, interfaces and systems are in scope?
  • What is the expected number of concurrent clients that will access the services?
  • What is the payload of the incoming requests?
  • What is the service workload mix i.e. % mix of the different services?
  • What does the target hardware and network systems look like?
  • Testing the simultaneous access of the service by multiple clients to replicate production
  • the maximum transaction rate (Throughput) that the service can support
  • The size of the incoming requests beyond which the service behaves in unexpected ways
  • The number of concurrent clients calling a specific number of transactions within a set duration.
  • Testing to measure the frequency of errors or system crashes to determine whether the system performs adequately.
  • Assuring that the request actually originated from an authorized source. In addition to authenticate the source, the service provider may need to prove the message origin to other consumers

Security Testing

  • Protocol or encryption standards testing – this provides assurances that the service transactions are encrypted using the defined encryption techniques. Secure encryption standards should prevent attempts to decrypt traffic, known as encryption attacks.

Test automation tools for web services:

There are a number of Web Services Test Automation tools available in the market today. Two worth mentioning are: WebInject, SoapUI & TestMaker. Before we briefly discuss each of these, let us turn towards some of the prime features of the Web Services Test Automation Framework:

  • The XML requests are easily parsed with inputs
  • Customizable frameworks are developed based on the requirements.
  • With minimal coding effort test script creation is enabled.
  • Flexible test suites and test cases can be configured
  • Instantly sets the headers and assertions for SOAP requests

WebInject is a free tool for automated testing of web applications and web services.

WebInject is primarily an execution and reporting engine. It can be used to test individual system components that have HTTP interfaces (JSP, ASP, CGI, PHP, AJAX, Servlets, HTML Forms, XML/SOAP Web Services and REST etc.)

It can also be used to create a suite of [HTTP level] automated functional, acceptance, and regression tests.

  • WebInject can be used as a complete test framework, which is controlled by the WebInject User Interface (GUI).
  • HTTP response times can be collected and monitored in real-time during test execution.
  • Timer statistics are calculated and displayed in a monitor window during runtime.
  • For graphical trending of web service-levels, WebInject is able to run in a mode that makes it compatible with MRTG (an open source tool for collecting, storing, and graphing time-series data.)

SoapUI is designed for validating web services. SoapUI is a tool for functional testing, web services testing, security testing and load testing.

It is the most used web services API testing tool.

SOAP is language written using XML, hence is platform independent.

Sometimes RPC (Remote procedure calls) are blocked by firewalls and proxy servers, to overcome such issues SOAP was designed.

The SOAP debugger acts as a Web services proxy that allows you to intercept and inspect the SOAP request and response messages that are sent between the client and server SoapUI has User Friendly GUI SoapUI enables developers, testers, and IT managers - both technical and nontechnical - to build test suites and test cases of SOAP-based and REST-based Web services in an easy graphical environment.

SoapUI Request, sends an HTTP request to a destination and accepts a response.

SoapUI will also unleash load tests on a Web service

TestMaker is a web service testing application from PushToTest.

HTTP Protocol level testing for optimization of Web pages.

To achieve business service monitoring in Service Oriented Architecture (SOA) and Web Service environments, Eviware SoapUI is the recognized open-source Web service test suite development tool.

PushToTest integrates SoapUI fully and takes SoapUI to entirely new levels of testing and service management. PushToTest TestMaker operates SoapUI tests

The largest of TestMaker's libraries is TOOL (Test Object Oriented Library), which includes classes for handling all sorts of communication protocols like HTTP, HTTPS, SOAP, POP3, JDBC etc. You can, therefore, create test cases that approach or surpass any client application the Web service is likely to be called by.

Benefits by adopting web services test automation frameworks:

  • Performance and reliability of the SOA are improved
  • Eases testing of both SOA-based and REST API-based web services
  • Test execution of web services in a cloud environment are also Supported
  • Reduces Testing efforts over regression cycles
  • Ensures 100% Functional Test coverage