Forum Discussion
Sub Param_LogInId
Dim VirtualUsers(6)
dim User
set TestInstance = LoadTesting.Tests.TestByName("QA_Login").CreateTestInstance
set Station1 = LoadTesting.Stations.ItemByName("Master")
set Station2 = LoadTesting.Stations.ItemByName("Indira")
For i = 0 To 5
Set HTTPTask = LoadTesting.HTTPTask("QAFA_Login")
Set request = HTTPTask.Connection(5).Request(2)
if (i = 0) Or (i = 1) Or (i = 2) Then
request.BodyVariables.Item("txtUserName") = "aprilg"
request.BodyVariables.Item("txtUsrPassword") = "aprilg"
else
if (i = 3) Or (i = 4) Or (i = 5) Then
request.BodyVariables.Item("txtUserName") = "gailc"
request.BodyVariables.Item("txtUsrPassword") = "regina01"
end If
end if
Set VirtualUsers(i) = TestInstance.user(CStr(i))
Set VirtualUsers(i).Task = HTTPTask
Set VirtualUsers(i).TestInstance = TestInstance
Set VirtualUsers(i).Station = Station1
next
call TestInstance.Run("SRI")
End Sub
So this is how i coded now. Will this work or do i have code like what you have given in the previous post.
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.
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 .
Did i give the virtual user object and request parameters correctly acc to the code what i have above.
EventControl1 = OnLoadTestingRequest(Sender , VirtualUsers(i) , request)
EventControl1.AttachToTestComplete
Please suggest how do i get the request body from this and post it to log.
Thanks you.