Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Web Service Testing with QTP

I want to automate testing of WCF Web Services(over TCP) using QTP's WebServices Add-In. However when I specify path of WSDL it gives me errors. Has anyone tried using QTP? or any other tool that I can use for testing?

like image 922
Unmesh Gundecha Avatar asked Oct 30 '25 23:10

Unmesh Gundecha


2 Answers

From what I know, QTP cannot be used for testing WCF services using NetTcpBinding. They should be using plain BasicHttpBinding for it to work.

like image 75
cruizer Avatar answered Nov 02 '25 11:11

cruizer


When I call a webservice I stipulate 3 manadatory parameters for QTP and then the parameters for the actual webservice itself. This works everytime (except wen the webservice is not running)

Here is an example of that:

'=============================================================================
' Define WebService
qtpP1 = "wsdl:=http://172.16.69.84:8080/testframeworkwebapp/services/STFSQLExecutionService?WSDL"
' Define service & port
qtpP2 = "service:=GenericSQLExecutorService"
qtpP3= "port:=STFSQLExecutionService"
' Define Webservice calling parameters
wsP1 = "Select Count(*) From PERSON_TABLE"

'====================================================================
' Call to the WebService
executeSQLByDBName = WebService(qtpP1, qtpP2, qtpP3).executeSQLByDBName(wsP1)

If WebService(qtpP1, qtpP2, qtpP3).GetLastError > "" Then
  MsgBox "WebService Issue"
Else
  MsgBox "WebServices Call Worked OK"
End If
'====================================================================
like image 20
Dilip Avatar answered Nov 02 '25 12:11

Dilip



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!