Forum Discussion

malj's avatar
malj
Contributor
9 years ago
Solved

Consuming WebSocket or REST services

We would like to use a tool for model-based testing that can provide a WebSocket or REST service. It does not seem like TestComplete supports any of these but I am not an expert on the area so, is there any chance it does?

  • You can certainly connect and converse with RESTful API's. I'm just finishing off a bunch of script extensions to make use of the new TFS RESTful API for updating test results in TFS from TestComplete.

     

    I use an "MSXML2.ServerXMLHTTP" object ( https://msdn.microsoft.com/en-us/library/ms766431(v=vs.85).aspx )

     

    Which can have headers and body attached and receives a response object in return containing response code, body text etc. Mine is primarily JSON so I'm also using http://www.aspjson.com/ in a script extension as my JSON parser. (Mainly as I'm most familiar with VBScript)

     

    Not so sure about websockets. Never tried to use them directly from TC.

3 Replies

  • You can certainly connect and converse with RESTful API's. I'm just finishing off a bunch of script extensions to make use of the new TFS RESTful API for updating test results in TFS from TestComplete.

     

    I use an "MSXML2.ServerXMLHTTP" object ( https://msdn.microsoft.com/en-us/library/ms766431(v=vs.85).aspx )

     

    Which can have headers and body attached and receives a response object in return containing response code, body text etc. Mine is primarily JSON so I'm also using http://www.aspjson.com/ in a script extension as my JSON parser. (Mainly as I'm most familiar with VBScript)

     

    Not so sure about websockets. Never tried to use them directly from TC.

    • malj's avatar
      malj
      Contributor

      I was primarily thinking of the built-in support via GUI but I suppose we can create our own solution like you say. I believe I have used that object to connect to a web service somewhere else. Thanks for the tip, also on the JSON parser. I remember having a problem finding a good parser to use from VBScript.