Ok, I have read that you can sort of stagger the users of test scripts by browser connections and iterations.
I have staggered the scripts as well by using different client machines and staggering the start time of each script to be run.
Is there a way to stagger the browser connection start times for a script????
(this seems to be the most commonly repeated question here...go figure, since MS didn't bother actually including this feature...which would have been NICE)
I use a function that assigns a delay based on the "user number" that ACT automatically assigns if you don't declare your own users (I handle logins/pw inside the script, rather than letting ACT handle it). It takes the "user number" minus one and multiplies by some delay amount. So if the delay is 2 seconds, user 1 is 0 delay, 2 is 2 sec delay, and so on. I use a global variable (OOP programmers can "boo" me here) that turns "on" once the first users first iteration finishes. When that variable is On, there's no delay, and when it's off, there's the delay. This way, the first user to finish turns on the variable after the final user has already started. So no matter how long the test runs, there is only one delay per user.
'Stagger users so that all threads will be spaced apart, and most users will all be doing
Dim oUser, lUserNumber, lLength, strUser, lNapTime
iBeenUsed = Test.GetGlobalVariable("iBeenUsed")
If (iBeenUsed <> 1) Then
Set oUser = Test.GetCurrentUser
lLength = Len(oUser.Name)
'oUser.Name's is customer#
lPosition = lLength - 8
lUserNumber = Mid(oUser.Name, 9, lLength) + 1
If (lUserNumber <= lUsers or iBeenUsed <> "iBeenUsed") Then
lNapTime = (lUserNumber - 1) * lStaggerAmount
Test.Trace("User " & lUserNumber & " went to sleep for " & (lNapTime / 1000) & " Seconds. ")
iBeenUsed = lUserNumber + 1
'Then at the end of the test run, I add
Call Test.SetGlobalVariable("iBeenUsed", 1)
(looking at preview) This looked a lot prettier before they stripped out the extra spaces and tabs.