First of all, I would like to thank all the readers of LearnQTP and forum members for their great patience reading out my series of posts on DotNetfactory and Databases in QTP and for their valuable comments in each post. Special Thanks to Ankur, for giving me the exceptional opportunity to share my experience to the community.  Once again I am here with a new series of posts which will focus on Web Services Testing using QTP.

The series is divided in four parts

  1. Testing Web Services – Key Concepts
  2. Web Service Testing Wizard
  3. Adding Web Service Test Object to Object Repository
  4. Testing Web Services without enabling Web Services Add-in

In this first article I will focus on important key concepts of web services that you should know before start testing Web Services.
Web service is the way to connect different services together into a Service Oriented Architecture (SOA). Web services provide an application integration technology that can be used over internet and take Web Application to the next level.

QTP Web Services Testing

HP Service Test and QTP Web Services Add-in are great solutions for Web Services testing. HP Service Test Management module plugs into Quality center. We need QTP Web Services add-in in order to work with web services which can be downloaded from HP Download Center.

Let us first understand web services key points need to know before delving into testing with QTP. Typically a Web Service is a set of all related functions which are invoked to other application or services over the Internet. The information to programmatically invoke a Web service by an application is given by a Web Services Description Language (WSDL) document. Web Services Description Language (WSDL) is an XML-based language for locating and describing Web services. Now as the Web Service is powered by the web application server that uses SOAP to understand and speak with web services and delivers information in XML. Simple Object Access Protocol (SOAP) is XML based protocol to exchange information over HTTP. To locate the web services WSDL documents are indexed in searchable Universal, Description, Discovery and Integration (UDDI) business registries.

To access a Web service, it will have the WSDL path. But in case you are not aware of it you will have to use UDDI to find the service. You can make a search on Google to find the WSDL. Type below text in google to search

“inurl:wsdl site:w3schools.com”

you will find the public example web service provided by W3C. On accessing the WSDL (http://www.w3schools.com/webservices/tempconvert.asmx?wsdl) you will come to know about the access points and interfaces available for the web service. Something like the snapshot below –

WSDL XML

This web service has two methods ‘CelsiusToFahrenheit’ and ‘FahrenheitToCelsius’ and simply takes the temperature and converts it to the required.

There is one most important element in WSDL, which is Port. WSDL Port defines the connection point to a web service. It can be compared to a function library or a module or a class in traditional programming language.   You can find the service name and port in below section of WSDL.

WSDL Port Section You can understand this Web Service better when you will navigate to the W3C web service example , where you can see the interface for the web service.

WS Interface

If you click any of the two operations there it shows you the form to input parameters required for the operation and invoking this will give you the result in XML.

WS Form

Just below the form you will see sample SOAP request and response, which is actually processed when the web service is invoked.

SOAP Request

SOAP Request

SOAP Response

SOAP Response

The ‘string’ (in blue) that you see is actually replaced by the value that you process.

So now you must be ready to start testing this in QTP.  We will see the various intricacies of web service testing with QTP in the next part.