Forum Discussion

chiragsingh's avatar
chiragsingh
New Contributor
14 years ago

Replay Response Body

How can we see the request and response body for replayed script?
  • Hi,



    No, it just tells about the recorded traffic...I am looking to track the request-response body for replayed script . One section is there regarding capturing the body and writing it to the file...i m working on it.



    Thanks for your help..:)
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Chirag,



    Can you describe with more details what do you need?

    The case is that request and response contents (both header and body) for the executed test can be seen in the test log.

    OnLoadTestingRequest / OnLoadTestingResponse event handlers that are described in the help topics I referenced, make it possible to modify (or just read) the contents of the request(s) been send to the server and response(s) received back - however note that test lose concurrent execution if it uses event handlers.

    I hardly can imagine that you need to print (or just save to the file) the whole traffic for the test executed on behalf of 20-50-100 users and this was the reason for my question.
  • Thanks Alexei..



    To state my requirement clearly, here is the explanation...




    • When we perform load testing, the first step is to record the Script. I am able to perform this successfully using Test Complete.



    • The next step is to enhance the script by parameterizing the variables and coorelating the dynamic Session values. For this we referred to the online documentation and have performed the steps in our test script.



    • Finally, we need to replay back the script and verify if the requests made are successful. This is where we are seeing a challenge. For the Replay, we could see only the Request and the Response Header...there is no body or the snapshot of the page to refer back. A response code of 200 (in Response header) is not just sufficient to check if the request has succeeded, because of the dynamic pages that vary with the user input.




    So, what we need is to see the replayed Request & Response Completely (Header + Body), primarily to ensure,



    a) The request carries the correct set of parameterized and coorelated data

    b) The response received is as per the request made to the server.



    Options like implementing Checkpoints in the script, are helpful in verifying the functional correctness of the load test script. We could not even find a way to implement text checkpoints in out load test script that has been prepared using test Complete.



    Hope I have made the requirement clear. Any help would be appreciated.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Chirag,



    I think that request bodies are not logged because of performance considerations. Also they may be in different format and take a reasonable space.

    If you need to log them, you can use the OnLoadTestingRequest event I mentioned earlier and look for its .RequestBody property. See HTTPRequest.RequestBody and HTTPBody Object help topics for more details and code samples.
  • Hi Chirag,


    Alexei is right. Currently, to access and log request and response bodies during the playback, you can create event handlers for the OnLoadTestingRequest and OnLoadTestingResponse events. Please see the Checking Server Response help topic for an example demonstrating how to create a handler for the OnLoadTestingResponse event and to verify server responses.



    As an alternative, if you don't want to use event handlers to check server requests and responses in your script code, you can use a third-party debugging proxy server like Fiddler (which is a freeware tool). You just need to configure your proxy server and specify the HTTP Proxy Server settings of TestComplete to send simulated HTTP traffic via the proxy tool. It will record all HTTP requests simulated by TestComplete and appropriate responses received from the tested Web server. Then, you can easily inspect these requests and responses (both headers and bodies) with the debugging proxy tool.