Question

I'm looking for some ideas for how to overcome this problem :- I have a script that performs a login then performs business transactions then logs out.

To debug the script I replay it. The login works and I am logged into my system, but the script fails during the business transactions, that's what I expected, I'm replaying to ID the points I need to correlate.

But I have a problem. When the script stops my user is left logged in. I cant log the user out, I have to wait for the user session to timeout before I replay the script again.

I have captured the logout process into vuser_end, is there a way I can force replay to continue after a failure and then manually set the next command to be executed (So I can run the logout part of the script) - If that's possible Can I pass a variable in to the logout, a variable Id need to capture from the "immediate window" (I know that doesn't exist - its best description I could think of)

Was it helpful?

Solution

Continue on error is a poor recommendation. It is intended for situations where in your code you are taking on the responsibility for branching he execution of your code when an error occurs instead of having the system simply lock you out.

I propose a different model. Testing teaches us that for each and every step we have an expected result. Check for these expected results in your test code as your virtual user executes. If you do not receive the expected result, such as in the case of a missing dynamic system variable (a correlation) then branch the code immediately to the logout for your system. If you continue past the unfulfilled item as in the case of continue on error being enabled then you are more likely to wind up with a 500 class error related to submitting a request out of context with the state of the sytem or a bad/old variable than you are to successfully end up logging out.

As an alternate path you can have the process documented by the system administrator on how to kill an orphaned login session for a user and use that to kill your session.

There is a positive which has come from this. When you hear people discussing how many people are on the system which need to be reproduced now you have a direct example that shows that a number of those individuals are not actually on the system working but are simply sessions waiting to time out. This is why the system logs are often a better measure of who is on the system at any given time than the reporting for number of "user sessions" which are alive in the management console.

OTHER TIPS

You can force your script to ignore errors and continue to execute the script code.

Open the Run-Time Settings panel.

Navigate to the 'General' > 'Miscellaneous' panel.

Check the checkbox labeled 'Continue on error'. This will attempt to force the script to barrel on through the errors and you can put in your own error checking code including manually passing/failing transactions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top