Forum Discussion
AlexanderM
Staff
15 years agoHi Sri,
Will this work or do i have code like what you have given in the previous post.
Yes, your code should work fine.
My problem in this is i tested this by giving the wrong request number and connection numbres where the prarameters are not there. butstill the load test is going on as ususl without reporting that this parameter is not there in this request.
When a parameter you assign is not present in a request, it is added to the request, so no error occurs. During test execution, the server ignores the parameters it does not expect from the client, so no error occurs in this case either. That is why this mistake does not cause any errors.
I read about OnLoadTestingRequest, and this is the syntax i am finding. I really don't undertsand how to create this event for my load test and what is the parameter sender is .
You can find the step by step instructions for event handler creation in the Creating an Event Handler for the OnUnexpectedWindow Event help topic. The same exact steps are used to create the OnLoadTestingRequest event (except for the actual event you select). Please read the help topic carefully to get the idea.
Once the event handler is created, you need to specify which request you need to handle the event for. To do this, open the Load Testing task editor, select the needed request, switch to the Request tab, and enable the "Raise Events" check box.
Now, every time the request is about to be sent to the server, the handler routine will be called and the current request data will be passed to it as parameters.
The handler routine can look, for example, like this:
Sub GeneralEvents_OnLoadTestingRequest(Sender, User, Request)
Dim FileName
FileName = "C:\LT\RequestBody_" & User.Name & "_" & Request.RequestID & ".txt"
Request.RequestBody.SaveToFile(FileName)
End Sub
I hope this helps.