Skip to main content

skip to main content

developerWorks  >  Rational  >

Working with time intervals for Virtual User login with IBM Rational TestManager

developerWorks
Document options

Document options requiring JavaScript are not displayed


Rate this page

Help us improve this content


Level: Introductory

Mikhail Lekhter (mikhail.lekhter@excellus.com), Automated Scripts Developer, Excellus Blue Cross Blue Shield

06 Feb 2007

Changing a single line of code in IBM Rational TestManager allows you to have Virtual Users log into the application under test with a flexible time interval.

Logging in Virtual Users

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.

Start testers in groups

A single line of code allows Virtual Users to start logging into the application with a time interval that you define.

  1. In the declaration section of any Login script, 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).

  2. 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.

Start all testers at once

If you use the Rational TestManager runtime setting Start all testers at once, you can use an even simpler line of code.

  1. In the declaration section of your Login script, declare and assign values for 1 variable:

    int interval=15000;

  2. 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.



Back to top


Summary

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.



Resources

Learn

Discuss


About the author

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.




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top