Testcomple with API testing
I came to know that testcomplete is not supporting REST protocol for API/webservice testing.
we can still do it wih msxml2.serverxmlhttp.6.0
So i tried below code in testcomplete giving me error Object expected
at line one which object should pass?
or is there any way to test REST based service in tetscomplete.
ServerXmlHttp = CreateConnection("MSXML2.ServerXMLHTTP.6.0");
ServerXmlHttp.open ("POST", "http://www.domain.com/page.asp")
ServerXmlHttp.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded")
ServerXmlHttp.setRequestHeader ("Content-Length",Len(PostData))
ServerXmlHttp.send (PostData)
if (ServerXmlHttp.status = 200 )
{
TextResponse = ServerXmlHttp.responseText
XMLResponse = ServerXmlHttp.responseXML
StreamResponse = ServerXmlHttp.responseStream
}
else
{
log.message(" Handle missing response or other errors here")
}