Abort vuser at the time of load

148 views
Skip to first unread message

Vicky

unread,
Jul 27, 2011, 1:58:21 AM7/27/11
to LoadRunner
Hi everyone,

At the time of load i want to abort vuser from further process or from
complete execution, if any error comes. As in my application,
dependencies are there on previous iteration fro every new one. Eg. If
single vuser work for 20 iteration and due to some error 5th iteration
got failed then further 15 iterations also failed, so i want to abort
that particuler vuser from further execution.

Can someone tell me how to abort that particuler vuser from further
execution.

Regards,
Vivek

Vivek

unread,
Jul 27, 2011, 7:01:22 AM7/27/11
to lr-loa...@googlegroups.com
It's always best to investigate where and why error occurs in your script by increasing the log level in script development phase i.e., isolate and debug the errors before you move the script to controller for execution. Use appropriate error handling to prevent the script from failing in case of any errors.




--
You received this message because you are subscribed to the Google "LoadRunner" group.
To post to this group, send email to LR-Loa...@googlegroups.com
To unsubscribe from this group, send email to
LR-LoadRunne...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/LR-LoadRunner?hl=en

James Pulley

unread,
Jul 27, 2011, 7:44:56 AM7/27/11
to lr-loa...@googlegroups.com
return(-1);

James Pulley

unread,
Jul 27, 2011, 10:26:24 AM7/27/11
to lr-loa...@googlegroups.com
Just in follow up, since I prattled the below off in the car....

Return(0); = Exit iteration, continue to next iteration and respect pacing
Return(1); = Exit iteration, continue and ignore pacing. Iterate
immediately.
Return(-1); = Kill this virtual user with extreme prejudice never allowing
it to run again without a manual restart - Bad VU!

'Pulley

Sagar Aggarwal

unread,
Jul 27, 2011, 11:13:33 PM7/27/11
to lr-loa...@googlegroups.com
You can abort Vusers but don't you think , that if you have some errors during execution say 20.it means you are aborting 20 Vusers.Then whatever response time you will be getting not at all accurate as you are testing your application with a decreased load and decreased iterations.

I have also work in same kind of script..What I did was that instead of aborting that particular Vuser.I created one Action "Err_Login"  in which I added the code of my Vuser_init.So whenever there was some error in particular iteration rather than decreasing Vuser load my script was calling "Err_Login" action and starting the execution from loading of home page.This might not give me 100% accurate result but it is still better than decreasing Vuser Load and decreased iterations..

Expert People.. Please comment on this,whether this approach was fine or can we have some better approach ?
All comments are welcome including harsh ones as well :)

André Luyer

unread,
Jul 28, 2011, 5:03:24 PM7/28/11
to LoadRunner
To answer the OP: use lr_exit or lr_abort function for readability.
You can also use the the return statement, but that may be confusing.
To add to James post:
return -1; (or anything <0) in the Run phase means go directly to End
phase (vuser_end),
return -1; (or anything <0) in the Init phase means abort immediately
-- this is actually useful.
You can use a global counter to count the number of failed iterations
and abort when it reaches 15. And reset the counter at the end of a
successful iteration.

You should do this only if the failed iterations are due to the
application you're testing and not to cover bad scripting.

The use of a "Err_Login" is fine, but it is better if a iteration is
not depended on the previous state (but depend on the state when the
Init phase ended). Since one of the requirements of a performance use-
case is that is must be repeatable.
In case the Vuser should login and logout during the iteration you
should also mark the login-state, so you know what to do to recover
from a error condition (or use the lr_on_error function).

André

siva a

unread,
Jul 31, 2011, 2:25:21 AM7/31/11
to lr-loa...@googlegroups.com
Hi vivek,

Any time if we move to the controller, all the errors in script were find in the VuGen only...then only we move to the further steps...in this way the things are doing fine....



If we go through the controller all the errors will be found and the script has available to us any situation....

Vivek

unread,
Aug 1, 2011, 6:51:15 AM8/1/11
to lr-loa...@googlegroups.com
Any time if we move to the controller, all the errors in script were find in the VuGen only

I don't understand your reference. Care to elaborate?



--
Reply all
Reply to author
Forward
0 new messages