I have a test case, where the application is sending a polling type request. If the data is not available the server simply responds with http 200 status and a message "Waiting for response". If this response is received, the browser will send the URL again after 2 sec. This will happen until the expected response is received or 10 mins max.
To simulate this scenario, I have created a while loop inside which I am sending my request and then checking the response. Based on the response, I am setting the value of time in delay. (Check the screenshot). Now my requirement is to capture the response time for this whole activity i.e. from sending the request for the first time till we get the last response including the delay time.
When I run this scripts and check the reports, the average response time values are very small like 0.063 sec for the Transaction enclosing the while loop. This is not what I am looking for, as I know, I am not getting the response in the very first attempt. So the final response time must include
Response Time = Request response time every time it goes through the while loop + Delay time every time it goes through while loop.
So for eg: if the while loop is executed twice, I am looking for something like
Resp Time = 0.50(first iter in while) + 2 sec (first delay) + 0.55 (second Iter in while) + 2 sec (Second delay) = 5.05 sec
Can someone help tell me how can I get them?