Forum Discussion
AlexanderM
14 years agoStaff
Hi Sri,
Do i have to specify Task name or Test name in the last call statement.
I guess, you mean the "call TestInstance.Run("QAFA_Login")" line. Let me quote the TestInstance.Run help topic:
The method has the following parameter:
Title
Specifies the name of the result group to which TestComplete will add summary results of the test run.
So, it can be any string value you like. You can read about result groups in the Load Testing Analysis Page help topic.
I am attaching the snap shot of the error i am getting and also the load test suite tree.
The runtime error you get is caused by the fact that the TestByName method returns the Test object, not the TestInstance object. The Test object does not have the Run method.
does it actually creates all the VU's first with specified User id's and Passwords and then runs the task after creating VU'S.
No, your script does not do what you think it does. The script gets the "QA_Login" test, but it does not modify the test - it creates a runtime copy of the "QAFA_Login" task six times, changes the created task copy, but does not assign it to a user.
To accomplish your task, you can create your test from script without using the visual load test representation:
Sub Param_LogInId
Dim TestInstance, HTTPTask, request, VU
Set TestInstance = LoadTesting.CreateTestInstance("MyTestLogin")
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
' Now create a virtual user and add it to the test instance
Set VU = LoadTesting.CreateVirtualUser("VU_" & i)
Set VU.Task = HTTPTask
Set VU.TestInstance = TestInstance
next
' Runs the task
call TestInstance.Run("MyResultGroup")
End Sub
How do i know the load test ran with the userid's and passwords i specified in the script parameters.
In the load testing log, you can see only the headers of the requests that were sent to the server. If you need to see the actual request body sent to the server, you will need to handle the OnLoadTestingRequest event for the needed requests and post the actual body contents to the Test Log.
Related Content
- 4 years agoryanterronez
- 4 years agobflynnbyx
- 11 years agosgoodman
Recent Discussions
- 33 minutes agosimonaferrara
- 39 minutes agoAli2