Is it possible for script to not loop?
Hello,
I am sure somebody will have an answer to this question. We currently run ANTS load to great effect within our business but have found we want to use some of the scripts we've created to simply run a single time rather than to continuously loop for a set period. At the moment we are doing this by running the script for 1 minute, multiplied by the number of users we wish to load (often only 1).
Obviously as the script might run for less than 1 minute, this is not exactly a science. So if anybody could advise a way we could run a script with multiple users only for the duration of the recorded script it would be greatly appreciated. It will also allow my team to obtain greater accuracy when reporting the results.
Thanks!
Nathan
I am sure somebody will have an answer to this question. We currently run ANTS load to great effect within our business but have found we want to use some of the scripts we've created to simply run a single time rather than to continuously loop for a set period. At the moment we are doing this by running the script for 1 minute, multiplied by the number of users we wish to load (often only 1).
Obviously as the script might run for less than 1 minute, this is not exactly a science. So if anybody could advise a way we could run a script with multiple users only for the duration of the recorded script it would be greatly appreciated. It will also allow my team to obtain greater accuracy when reporting the results.
Thanks!
Nathan
This discussion has been closed.
Comments
If you want to get something to run exactly once, you can set up the test the way that you already have, with 1 virtual user running for one minute. To prevent it from possibly running again, you can try putting a one-minute sleep() command at the end of the script.
To be even more exact, you can enclose all of the actions of the Run() method inside of in If/End If block that will not run if you set a variable in another class at the end of the first script run. There is a bit more detail in another post here:
http://www.red-gate.com/messageboard/vi ... .php?t=954
In any case, this assistance is greatly appreciated.
Coding the limit into the script is probably the cleanest way to go. It's a bit more work, though!