Apart from Web Services Testing Wizard we discussed in last part, let’s find out what are other possible ways to work with Web services in QTP. What about adding Web services objects directly into object repository and use the test object to add steps in test or component.
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.
Close the Object Repository and the test object is now ready to use in your test. To use a web service test object use ‘WebService(<Test Object>), and you can access any of the operations available.
so as of now, we have seen that we add a test object in the repository and can do further processing. Let’s now see how can test a web service without adding the test object in the repository.
A web service test object requires three main description properties to invoke a method. Which are –
- WSDL
- Service and
- Port
Refer object repository for already added test object
if we can define these in the script we will be able to access the methods of web services.
WebService(“wsdl:=<your wsdl>”,”service:=<your service>”,”port:=<your port>”)
So in order to invoke the method CelsiusToFahrenheit from the WSDL used in earlier parts you can have the statement in the script as –
Desc1 = "wsdl:=http://www.w3schools.com/webservices/tempconvert.asmx?wsdl" Desc2 = "service:=TempConvert" Desc3 = "port:=TempConvertSoap" ' Call to the WebService Fahrenheitval = WebService(Desc1, Desc2, Desc3).CelsiusToFahrenheit("25") msgbox Fahrenheitval
Which gives you the required output as 77.
All the other available operations can be carried out with this approach.
You can follow the entire web services testing and QTP here.
Hi,
I need to validate a SOAP Request against WSDL and execute it on a URL…. Similarly i need to get the Response and validate it also…..
Challenge is that i have to use Web Service add-in for this……
Please help with detailed information as i am a beginner 🙂
Following code is “Ram Ban” you can use it any where to get the response from any WSDL
Thanks Manish for your valuable post.
Hi,
In one WSBL, i have more than one method, so i would like create different actions for each method. So in the same script, when i create a 2nd action…these webservices are not getting poped up..
what to do?
Hi All,
I am looking for info on how to Read/Write to Message Queues(JMS/MQ)
Please suggest a solution.
need info on
The .NET Framework 2.0 WSE 3.0 toolkit returned the following error:
I am using following Webservice request.
I want to parameterize above request which replaces CreatePerson by a parameter ex: xyz then it looks like
. If i submit above request iam getting the error which says there is no request type with name xyz.
Please let me know if there is any other way to parameterize this.
Hi Ankur, – can you please explan Dynamic Test Object – it’s use ?
Thanks
Do you address the use of the Service Test Add-In for QC?
Thanks,
Bill
Hi Ankur,
Is there any way to find last iteration in QTP?
Thanks,
Srini
where do we download webservice add-in for QTP
Hi All,
I tried using following code after adding the WSDL file through Webservices wizard
During execution I am getting following error:
The initiatexyzRequest operation call failed.
The .NET Framework 2.0 WSE 3.0 toolkit returned the following error:
Failed to create client’s proxy object.
Exception from: System
Invalid URI: The format of the URI could not be determined.
Line (6):
Please if anyone has faced such a issue and knows the solution please share it ..
Thanks,
Shree
Hi Gurus,
I am trying to import XMLs to XMLWarehouse in run time. Do you have any sample of code for the same? Your help is highly appritiated.
Thanks,
Venkat
I am working on Webservices automation using QTP.
I am getting following error..Any one can help
The findAuthorization operation call failed.
The .NET Framework 2.0 WSE 3.0 toolkit returned the following error:
Exception from: System.Web.Services
The underlying connection was closed: The connection was closed unexpectedly.
Line (2):
Hi Ankur,
I have few doubts regardig Active MQ which are as follows:
Problem1:-
1) I have an automation project in which I am using quick test professional (QTP9.2).
2) It involves passing/receiving xml to/from system through JMS (as some step/s in test case).
3) We are using ActiveMQ as a JMS server.
4) QTP supports VB script, so can it be possible to communicate with JMS using normal VB script?
5) If not is there any other way to do that.
Problem2:-
1) I have heard of REST protocol which is supported by ActiveMQ and its a normal HTTP protocol.
(POST: to send and GET: to receive)
2) We can send an Http request using VB script and I have successfully done that.(i.e. sent an xml to queue)
3) But while receiving an XML using get I am getting “full head error”
Reason might be:
1) GET request has limited size but my response xml is in range of 0.5 to 1 mb.
2) Also I am getting string formatted xml so its even bigger for a GET request to accommodate.
Can anyone please help me out with this? In terms of,
1) How to overcome “full head error”
2) Any other way of JMS and QTP integration (message type is strictly big strings formatted xmls)
Thanks & Regards
Rahul Garibe