I need to run a load test and have my virtual users login with different names each time.
I've located the session and request for the login.
In the Request Tab there is a line under the POST info that says:
I need to make "user10000" into a variable that the virtual users will use.
The tutorial suggests changing the URL's variables but in this case the URL just has our login page. Nothing in the form of http://localhost/loadtesting/ltorder...ction=neworder
I'm suspecting (and not worried) that I'll have to script out the load test using "LoadTesting.CreateTestInstance". But I also thought, "Hey these guys are smart...maybe there's a way to simply have the virtual users accept something from a data source and use that without a log of fuss.
Yup need to script it. So here's my script so far.
At least it ran.
I'll keep anyone interested informed so they can use it also.
(The help was actually helpful! how helpful
Modifying Virtual Users' Traffic
Modifying Traffic in Scripts)
var VirtualUsers, TestInstance, i, HTTPTask, request, userCount;
VirtualUsers = new Array(200);
//Create a new load test
TestInstance = LoadTesting.CreateTestInstance("TestInstance1");
for (i=0; i<2; i++)
Your script seems to be correct, so I'm not sure that I understand what problem you actually face. Please zip your entire project suite folder along with the log of the failed test execution and send us the archive via our Contact Support form. Make sure that messages in your log correspond to the latest version of your tests. We will examine your project suite.
Here's a sample. Our users start at 10000.
I'm only testing 3 users.
The thing that got me was this.
When you look at the Request numbers, you might see something
Connection 0002 (url:80)
Request 0016 (home.do)
and so on.
Well when you enter the connection and request in your
script you might think "Hey it's connection 0002 and
request 0015 so I'll enter THIS.
request = VirtualUser.Task.Connection(2).Request(15);
You could not be more wrong.
It's actually the FIRST request and it's (of course)
a zero base 'array' so the line is actually
request = VirtualUser.Task.Connection(2).Request(0);
That took me a while to figure out.
So here's a simple script that will change the username.
Check the previous posts and picks to see.
var VUser, request1, request2, TestInstance;
for (i=5; i<8; i++)
//Obtain the task to run the loadtest against
LT_VU = "VU" + aqConvert.VarToStr(i);//Create a new user
VirtualUser = LoadTesting.CreateVirtualUser(LT_VU);
VirtualUser.Task = LoadTesting.HTTPTask("BETask");