Forum Discussion

JamieBrydges's avatar
JamieBrydges
New Contributor
8 years ago

How can you get the http response back using testcomplete?

Hi,

Is the their anyway to to get the HTTP response back from a webpage using testcomplete?

 

Thanks,

Jamie.

 

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Jamie,

     

    It would help if you provide more details about your task and what you have tried because the answer may depend on that.

     

    As a general considerations:

    -- Web page is not listening for incoming requests and thus cannot return any response;

    -- On the contrary, it is web server (or any other application with the same functionality) that listens for requests and answers with response;

    -- When an application (web browser or any other http-enabled application) sends a request, it, actually, puts the request into the network pipeline provided by the OS and it is OS's responsibility then to deliver the request to the addressee and return the obtained response (or the error) to the initial sender;

    -- Considering the above, the response can be obtained only if you are either the request's initiator or some entity within the network pipeline;

    -- TestComplete is not designed to intercept the network traffic and thus it cannot be used for the latter option. As a workaround, you may use some third-party tool that is designed to intercept the network traffic (Fiddler is one of such tools) and provide you with the needed data;

    -- You can write a script in TestComplete to send the http request (the former option) and in this case your code will receive the response which you can process then. I don't have a sample at hand at the moment, but you may search this forum or just google for something like 'script xmlhttp send request' to get code sample on how to send http request from script code and process obtained response;

    -- If your tested application communicates with some web service, then you may consider Web Services functionality of TestComplete. See TestComplete's documentation for more details about web services support in TestComplete.

    • JamieBrydges's avatar
      JamieBrydges
      New Contributor

      Hi,

      No that's answered my question fine.

       

      Thanks,

      Jamie.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi Jamie,

         

        OK then. :) Thank you for the update.