Very much a newbie to this so please explain everything just to a 5 year old.
I have SP 7.5.0 and want to load test an application that requires log in on a webpage before being directed to a webform.
The real users will do data entry so will log in at start of day and then enter x amount of responses from trade show forms.
At end of day they log out again.
When setting up/recording the script I cannot get past the login page without logging in so it's a part of the script and when I run script it logs in every time causing errors because the login server can't handle the amount of users.
What I'm looking for is a way to amend script so the Vuser logs in once at the beginning and then makes x amount of responses.
I was thinking of putting the logging in into the TInit section but it keeps giving me errors because vaiables are suddenly undefined etc.
Am I on the right track? Is there a help doc for this particular issue?
Edit, or is it possible to run a "log in" script once and then follow up with "enter response" script on a loop?
You should be able to move the login steps into the TInit section which is only executed once at the beginning of the test. And move any logout commands into the TEnd or TShutdown section.
What I think is a better way is to move the login section into a function which you call from TInit.
Then also setup an html validation which occurs on every page via an events.bdh file. Look for something in the HTML which would indicate that the user is no longer logged in, then call the login function to re-login the user.
Hm, I did what you said but instead of calling a file I just put the "logging in" code in the TInit and the "loop" code in TMain.
However, while the code in TInit logs me in OK, once the TMain starts it's like the session has been dropped and I get page not found when the loop starts.
How can I retain session state between TInit and TMain?
Hard to be sure with the limited information you provide here, but basically you need to make sure all variables are declared globally, and NOT within each transaction. Sounds to me like the session and or cookie carrying the session is not getting from tInit to TMain.
So if it's in a variable, make sure it's declared in the top of the script and NOT within the particular transaction.
If it's in a cookie, capture it, put it in a variable and use that variable to re-set the cookie in TMain.
solution is easy if you know the answer: start recording script until the point you want to do the loop, start new transaction by clicking the button in the recording menu, type a transaction name, continue to record script, you can easily increase the number of iteration of the transaction you created!