• Home  / 
  •  /  VIDEO – How to test a web service using QTP with the web service add-in

VIDEO – How to test a web service using QTP with the web service add-in

In this video I show how to test a web service using HP’s QuickTest Professional.

This is the Microsoft.XMLDOM function that I used for the demo:

Public Function GETNODE(xmlString,nodeName,optNodeNum)
Dim xmlDoc
Dim nodeList
Dim currentNodeValue
Dim nodeFoundFlag
Dim nodeCounter
   Set xmlDoc = CreateObject("Microsoft.XMLDOM")
   xmlDoc.Async = "false"
	   if optNodeNum = "" then
		   optNodeNum = 1
	   end If
	   Set nodeList = xmlDoc.getElementsByTagName(nodeName)
       nodeCounter = 1
	    'If an element is not found that matches the passed nodeName then this for loop will not run
				For each Node in nodeList
					currentNodeValue = node.text
					'If there are more than one element with the same name stop on the optNodeNum or default to 1st  matching node found
						If cint(optNodeNum) = nodeCounter then
							nodeFoundFlag = "True"
							Exit for
						end if
				   nodeCounter = nodeCounter + 1
							If nodeFoundFlag = "True" Then
								GETNODE = currentNodeValue
							   GETNODE = "False"
							End If
Set xmlDoc = nothing
End Function

Succeeding with Automation Awesomeness. I’ll show you how!

Test automation, like all development efforts, is difficult. Most projects don't succeed. You can do better! Sign up and receive exclusive content like my free 10 Proven Actionable Steps for Automation Awesomeness from some of the biggest testing leaders in the industry. Let me help YOU succeed with Test Automation! Sign up now:

Click here to add a comment

Optin Architect