I have a webservice method that accepts double as parameter as follows:
But I would like to validate that it does not accept bad strings and I tried the follow:
'Test invalid argument
What I found is that QTP does not allow the test to run and keep complaining that "input string was not in the correct format".
I am aware that this is the situation but all I wanted QTP is to let the test fail but not halt. I would also like to configure what the fail message should be e.g. The application should return " bad argument in the SOAP call.
This will mean that if the webservcie returns " bad argument", then the test has passed.
How do I do this? Please help.
If it is not panadaol, its not the same as panadol
In order to send a web service request without using the toolkit proxy, you can use the "SendRequest" method of the WebService test object.
' Get the last soap request as XmlData object (see quickTest help).
Set SoapRequest = WebService("TestWsFunctionsService").LastRequest
' Save the last Request to XML file.
' Load soap request from XML file (after you made your changes).
Set NewSoapRequest = XMLUtil.CreateXMLFromFile("c:\SoapRequest.xml")
' call the Web-Service with the new soap request data.
WebService("AddrBookService").SendRequest "getnewValue", NewSoapRequest
The best way to manipulate XMLs in QTP is by loading the XML file into XmlWarehouse, and then parametrize the specific values.