Skip to main content

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

Mikhail Lekhter (mikhail.lekhter@excellus.com), Automated Scripts Developer, Excellus Blue Cross Blue Shield
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.

Summary:  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.

Date:  06 Feb 2007
Level:  Introductory
Activity:  351 views

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.


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.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=193204
ArticleTitle=Working with time intervals for Virtual User login with IBM Rational TestManager
publish-date=02062007
author1-email=mikhail.lekhter@excellus.com
author1-email-cc=rjbence@us.ibm.com

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers