0 Shares 1549 Views 4 Comments

Testing Web Services using QTP

May 10, 2013
1549 Views 4

I had written this series of Posts on Testing Web services using QTP at LearnQTP.com, I am just sharing the links for all the posts from this series, I hope this will surely help you in automating web services testing.

Web Services and QTP – Part 1: Testing Web Services Key Concepts

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.

 

W3C defines – A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.

Testing web services is no different than testing any other application/software program, but there are some unique challenges.

Web service based architecture is intrinsically distributed and is dependent on various stakeholders, which makes it difficult to establish availability and quality of service across the various stake holders. Most likely Web Services could be dependent on third party web services. And these third party web services can be changed without any information

Web services in an inter-enterprise SOA are so loosely coupled than the traditional architecture that tracking message route between different Web service stake holders is difficult.

Web services testing is basically the validation of interface points, messages and message formats which is quite different from testing the GUI.

Testing tools which are using GUI based automation is simply inadequate for Web services testing, but we don’t have to worry too much as we have QTP. Ian Fraser has well said it –

“The true beauty of QTP is that the only limitation is your imagination and ability to code in VBScript.”

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 Centerimages

Web Services and QTP – Part 2: Web Service Testing Wizard

When you are about to test a web service, make sure you have enabled Web Service Add-in for QTP. Once you have the add-in properly loaded you will see web service pane at Test Settings and Options. Web services toolkit option enables you to select a toolkit you want QTP to use for web service operations. For new tests and components, the default toolkit is the same as the toolkit set in the Web Services pane of the Options dialog box for learning Web Service objects.

QTP performs validation using the WS-I validation tool. The Web Services Interoperability Organization (WS-I) is an open industry organization chartered to establish Best Practices for Web services interoperability, for selected groups of Web services standards, across platforms, operating systems and programming languages.You will need to specify the path of validation tool in web services pane at option, and then you can access the tool by selecting Tools > validate WSDL.
images

Web Services and QTP- Part 3: Adding Web Service Test Object

QTP provides Web Service Add Object Wizard which helps you to add the test object into the repository. These web service test object behaves same as any other test objects while creating the steps in test i.e. we can access all its operations  in keyword view or in expert view.

To open the Add object Wizard click the object repository at toolbar or select Resources > Object Repository. Select Object > Web Service Add Object Wizard. The Web Service Add Object Wizard opens to show the Specify WSDL for Scanning screen.

Specify the URL for your WSDL as you did at Web Service Test Wizard and click Next.  It will now show you the select service screen. Here you can select the service and Port from the available list. And click finish.images

 

Web Services and QTP- Part4: Testing without Web Services Add-in

Yes, you got it right testing Web services can be done without using Web services add-in. All this is possible with the help of WinHTTP(Microsoft Windows HTTP service), which provides a high-level interface to the HTTP internet protocol.

We can use the com object WinHTTPRequest in our tests in order to invoke any operation to a web service. We will need to post the SOAP request to the web server using methods and properties ofWinHTTPRequest and we can get the corresponding response from the service.

Let us now try this out, open QTP and make sure you have not enabled Web Services Add-in in Add-in manager at startup.To retrieve the COM object of WinHTTP we use CreateObject method
images

You may be interested

Setting up Mobile Automation Project in Windows
Katalon Studio
77 views
Katalon Studio
77 views

Setting up Mobile Automation Project in Windows

Saket - Sep 20, 2017

This tutorial explains how to setup a mobile automation project and test a mobile app using Katalon Studio on Windows. This tutorial assumes that you are familiar…

Katalon Studio GUI Overview
Katalon Studio
147 views2
Katalon Studio
147 views2

Katalon Studio GUI Overview

Saket - Sep 14, 2017

GUI Overview After installing and setting up Katalon Studio for your automated test, you must understand the GUI. In this post we will walk you through the…

LeanFT Tutorial #4: Application Model Overview
LeanFT
124 views1
LeanFT
124 views1

LeanFT Tutorial #4: Application Model Overview

Saket - Sep 10, 2017

In this post we are going to focus on Application Model in LeanFT. Refer our earlier posts on LeanFT Getting Ready with LeanFT Browser Extensions and Settings…

4 Comments

  1. Pingback: Web Services and UFT : Testing SOAP Web Services - Automated360

  2. When i try to load a URL for validation, An error message is populated as “The Selected Service is Invalid. Select a Different Service.” Please help in this case..

    Reply

Leave a Comment

Your email address will not be published.

Most from this category

Join The Growing Group of 15000+ Test Automation Engineers

Signup for our newsletter and get access to free downloads, as well as tips, tricks and techniques and various test automation resources.
Name
Email Address
Secure and Spam free...