Many testers and release managers would like to see Virtual Users log in to the application under test using a flexible time interval. This scenario more closely mimics an actual environment, and helps avoid a big "crowd" of Virtual Users on the same line of code waiting for a server response. You can accomplish this using IBM® Rational® TestManager and modifying the Login script.
A single line of code allows Virtual Users to start logging into the application with a time interval that you define.
- In the declaration section of any
Loginscript, declare and assign values to two variables:int group=3;This value defines Rational TestManagerâs runtime settings as Start testers in groups. If the setting is Start all testers at once, you can give this variable a value equal to the number of Virtual Users that you are going to execute in your Suite.
int interval=15000;This is the time interval between Virtual Users (in milliseconds).
- Right before the very first http_request command, insert this line of code:
delay ((_uid%group)*interval);
This one line of code lets you divide Virtual Users in each group by interval time. The last Virtual User in the group will start to log in right away following the rest of the Virtual Users, with the interval time between each.
If you use the Rational TestManager runtime setting Start all testers at once, you can use an even simpler line of code.
- In the declaration section of your
Loginscript, declare and assign values for 1 variable:int interval=15000; - Right before the very first http_request command, insert this line of code:
delay ((_uid-1)*interval);
The first Virtual User starts logging in right away, followed by the rest of the Virtual Users, with the interval time between each.
These simple changes prevent the application under test from crashing before the stress test even begins. This is closer to an actual scenario, since the odds are that a large group of users will not click Login button simultaneously.
Learn
-
Visit the TestManager resource page on developerWorks for training, technical articles, free tutorials, and more.
-
Learn about "IBM Rational's software quality offering".
-
Browse the technology bookstore for books on these and other technical topics.
Discuss
-
Check out the Performance and VU Testing forum and get involved in the developerWorks community.
Mikhail works at Excellus Blue Cross Blue Shield in Rochester, NY, as an Automated Scripts Developer. He has more than 7 years of experience with IBM Rational Robot and IBM Rational TestManager. His day-to-day activities at work include creating, modifying, and executing performance and GUI scripts and suites. In addition, he analyzes test logs, test results, and test reports.
Comments (Undergoing maintenance)





