Forum Discussion
AlexeyKolosov
Staff
15 years agoHi Celalettin,
Your current code stores the recorded, not run-time, value of response body. I guess that's not what you need. The current request for which the OnLoadTestingRequest event is generated can be accessed via the Request variable passed to your event handler. Note that this event is generated only for those responses for which the "Raise Events" option is enabled on the Response tab of the Task Editor. If the option is enabled for multiple responses, you can use the unique ID of the request to identify the needed response. For example:
function GeneralEvents_OnLoadTestingResponse(Sender, User, Request)
{
if (Request.RequestID == myRequestId)
{
Log.Message("Response body for Request " + myRequestId, Request.ResponseBody.Contents);
}
}