| || |
Test webservice for failure
I am new to QTP and i am trying to use QTP to test web service execution.
I am able to execute successfully using the webservice wizard.
I have a security test where i am expecting the execution to fail, meaning the server to return a security failure.
But QTP script paused there with a popup saying current operation failed and toolkit gave the following error
Since i am expecting the error i dont want QTP to pause there. Is there a way i can solve this?
Re: Test webservice for failure
Here's the kind of thing we do
On Error Resume Next
p1 = "wsdl:=http://172.17.17.17:8080/testframeworkwebapp/services/STFSQLExecutionService?WSDL"
' Define service & port
p2 = "service:=GenericSQLExecutorService"
p3 = "port:=STFSQLExecutionService"
vSQL = "Select * From CUST_ACCOUNT Where CUST_ID = '1234567890"
vDBRef = "CUST.DB"
' Call to the WebService
executeSQLByDBName = WebService(p1,p2,p3).executeSQLByDBName(vSQL,vDBRe f)
If err.number <> 0 Then
Reporter.Reportevent micFail,"WebService Call Failed","Error Number: "&Err.Number
On Error GoTo 0