Forum Discussion
i want to execute the test firts 3 VU's with txtUserName: test1, txtUsrPassword : pass01.
The next 3 VU's with txtUserName: test2, txtUsrPassword: pass02.
The next 4 VU'S with txtUserName: test3, txtUsrPassword: pass03.
I hope you understan my scenario.
Now i has test designed, QA_Login, the task is QAFA_Login.
Now i wrote the script like this:
Sub Param_LogInId
set TestInstance = LoadTesting.Tests.TestByName(QA_Login)
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
next
' Runs the task
' call TestInstance.(QAFA_Login)
call TestInstance.Run("QAFA_Login")
End Sub
When i run this it is giving me VB Script run time error in the last call statement and says object required: "TestInstance".
Please suggest nad let me know if i can do it in any other way.