W3C defines a web service as a
system/software designed to support the interoperable machine-to-machine
interactions over internet.
A Web service enables the communication
between subsystems by using a combination of open protocols and standards, mainly
XML, SOAP and WSDL (Web service Definition Language). It uses XML to tag data,
SOAP to transfer a message and finally WSDL to describe the availability of
services.
Let's take a look at three main
components of a Web service.
- Simple Object Access
Protocol (SOAP) is a protocol for sending and
receiving messages between applications without causing any trouble in
interoperability.
- Web Services Description Language (WSDL) is a document that describes a Web service and also tells how to access and use its methods. A simple WSDL file is
- A description of a Web service
- The methods a Web service uses and the parameters that it takes
- A way to locate Web services
- Extensible Mark-up Language (XML) is an eXtensible Mark-up Language that enables us to identify and organize the data or information in a more accurate and flexible way. It is called extensible because it does not have a specific or fixed format. Using XML we can define any element and call it whatever we like.
Now what is expected from a Web
Service testing?
- Whether the services meet business requirement
- Validate the data transfer standards as per the business needs
- To validate whether the methods provided by the web service work as intended
- Validate the accessibility and compatibility of the services
- Verify the data against the data source
- Data types, optional content and size for each tag
- Define the test scenarios and test cases with more data transfers considering the every business requirement
It’s difficult to cover all the
possible end to end business scenarios with all the possible data combinations
but which can be handled using an automated tool to simplify the web service
testing. There are quite a number of tools available in the market to test the
web services like SoapUI, TestMaker, WebInject out of which SoapUI is the most
popular in the market currently.
Capabilities and features of SoapUI:
SoapUI is an open source web
service testing application for service-oriented architectures (SOA). Its
functionality covers web service inspection, invoking, development, simulation
and mocking, functional testing, load and compliance testing.
It has two versions of software, a
commercial version, SoapUI Pro, which mainly focuses on features designed to
enhance productivity, was also developed by eviware software. In 2011,
SmartBear Software acquired eviware.
We can test both SOAP and REST
APIs using this tool. Its most distinguishing factor when compared to
other testing tools is that it can be used for multiple forms of testing like
both functional and non-functional. Load, Functional and Security testing are
few testing types that can be successfully accomplished via SoapUI.
- SoapUI can be used to create efficient and comprehensive tests that are completely portable across multiple platforms. As it is built on Java.
- Data driven tests can be created with the help of external data sources like Excel, XML, CSV, Flat files etc.
- It can generate various types of report in which ever format we require like PDF, Word, HTML.
- We can even perform load test either web application pages or API’s to capture the response time, the network etc. as if any load testing tool does.
- Service mocking / MockServices, helps to mimic the web service behavior even before it is developed. This is a really versatile feature helps to minimizing the time that it takes to implement, test and correct it.
Some of the best practices in
thoroughly testing the web services
- Write test cases even if the services aren’t ready
- Ensure all the messages and elements are covered
- Testing the corner and boundary conditions
- Apply assertions to the test results
- Applying data driven automated testing can derive much benefit
- Maintain the test data for both input and expected output as well
- Using the random generator available with tool to generate meaningful data dynamically
Maximum productivity can be
leveraged with some of the practises like
- Linking service tests to rest QA environment
- Bring testing into the automated build process via integration of deployment tools like ant or maven
- Let end users interact with services via a forms based UI
- Add libraries of pre-packaged tests and logic
By
AutomationMentor
www.automationmentor.in
www.automationmentor.in
We provide hands-on training on automation tools and frameworks