Skip to main content

skip to main content

developerWorks  >  Rational  >

Load testing Web applications using IBM Rational Performance Tester: Part 2. Creating and running performance tests

Learn the basics of using Rational Performance Tester for load testing

developerWorks
Document options

Document options requiring JavaScript are not displayed

Sample code


Rate this page

Help us improve this content


Level: Introductory

Allan Tham (thamawh@my.ibm.com), IT Specialist, IBM 
Foong Yen Lee (leefy@my.ibm.com), IT Specialist, IBM 

11 Dec 2007

This second of the four articles in this series helps you get a jump-start in actually using IBM® Rational® Performance Tester. It guides you through installing an evaluation copy, creating a simple test, and running the test against the DayTrader application that is deployed on IBM® WebSphere® Application Server Community Edition and IBM® DB2® Express. It is also essential preparation for Part 3, where you will run tests on increasing sizes of user loads.

About this series

IBM® Rational® Performance Tester is a performance testing tool that emulates various user loads to mimic the real-life loads. With proper planning coupled with realistic simulation, this tool uses the current loads to estimate future loads. For example, a customer's application may potentially serve a total of 5000 users. With Rational Performance Tester, you can easily emulate the user loads at 1000, 2000, 3000, 4000, 5000 and beyond to project the right user growth, so that you can also project server sizing, such as optimal CPU and memory requirements, more accurately. You can identify and diagnose performance bottlenecks, whether such problems occur in the network, database, the application server, or even the user application. The root cause analysis capability further analyzes application tiers, which may include page components such as Enterprise Java™Beans (EJBs), servlets, a Java™ Database Connector (JDBC) API, Web services, and so forth. This functionality enables you to pinpoint the performance culprit easily and efficiently by analyzing the online or extracted reports.

Here's a quick summary of this series of four articles:

  • Part 1 gives you an overview of IBM Rational Performance Tester Version 7.0.
  • Part 2 (this part) walks you through the basics of using Rational Performance Tester by creating, running, and evaluating a simple test.
  • Part 3 covers testing as user loads grow (see the next section for more).
  • Part 4 is all about reports, because a load test is only as good as the reports of the results.

The goal of this series is to help you understand the features, topological considerations, and constraints so that you can create and test Web applications and analyze the performance reports. With this knowledge and the ease of use of Rational Performance Tester, load testing a Web application will no longer be a burdensome chore, and you can include it for each iteration of your software.

Overview of this article

In the first article of this series, you got an overview of the capabilities of IBM Rational Performance Tester, which helps automate much of the performance testing process. This second of four articles helps you get a jump-start in actually using this testing tool.

Part 2 guides you through installing an evaluation copy, creating a simple test, and running the test against the DayTrader application that is deployed on IBM® WebSphere® Application Server Community Edition and IBM® DB2® Express. It is also essential preparation for Part 3, where you will run tests on increasing sizes of user loads.

An optional section at the end of this article describes how to deploy the DayTrader sample application if you want to use it for testing. If you prefer, you can create the test against the application that you need to test for performance, instead.

Download an evaluation copy of Rational Performance Tester V7.0

Download the Rational Performance Tester evaluation copy installer from IBM developerWorks (three files, called RPT_V7.0_Part_1.zip, RPT_V7.0_Part_2.zip, and RPT_V7.0_Part_3.zip). The evaluation license is valid for 30 days from the installation date and allows up to 5 concurrent virtual users. You need to activate Rational Performance Tester with a purchased license key after the expiration date to continue using it. See Resources for links to the file downloads and to the IBM Rational Software Development Platform V7.0 - Desktop Product Activation area, where you can get the licenses and information about the activation process.

The machine that Rational Performance Tester is installed on is called the workbench. You will need a minimum of 1GB of memory and 1GB of hard disk space for this tutorial.



Back to top


Install Rational Performance Tester

These steps will guide you through the installation:

  1. Extract these three files into a temporary directory called C:\temp.
  • RPT_V7.0_Part_1.zip
  • RPT_V7.0_Part_2.zip
  • RPT_V7.0_Part_3.zip

    When you are finished, you will find three extracted folders: disk1, disk2, and disk3.

  1. In the disk1 folder, click the launchpad.exe file to start the installation.
  2. Select Install IBM Rational Performance Tester (Includes Agent) (see Figure 1).

Figure 1. Rational installation screen
Screen capture

  1. Accept the agreement when you are prompted, and click Next. The IBM Installation Manager will be installed first. Accept the default location for it, and click Next.
  2. Click Install to install the IBM Installation Manager, and click Finish when the installation is complete.
  3. The next screen will display the Rational Performance Tester packages to be installed. Make sure that IBM Rational Performance Tester Version 7.0.0 is selected (Figure 2), and then click Next again.

Figure 2. Install Rational Performance Tester packages
Screen capture

  1. Accept the license agreement again to install Rational Performance Tester, and click Next.
  2. On the screen that says Select a location for the shared resource directory, either enter a new location or accept the default location, and then click Next (Figure 3).

Figure 3. Shared Resources Directory field
Screen capture

  1. On the next screen, ensure that Check a new package group is selected, and either enter a new location for the installation or accept the default location to install Rational Performance Tester. Click Next. (Figure 4).

Figure 4. Rational Performance Tester installation location
Screen capture

  1. Click Next twice until you see the screen that says Select the Features you want to install. Accept the default, and click Next. (Figure 5).

Figure 5. Feature screen
Screen capture



Back to top


Install Rational Agent Controller

  1. Keep clicking Next until you see the screen titled Configure the IBM Rational Agent Controller installation (Figure 6) (IBM® Rational® Agent Controller is installed with Rational Performance Tester).
  2. Select Typical installation and click Next.

Figure 6. Install Rational Agent Controller
Screen capture

  1. On the Summary Information screen, click Install (Figure 7).

Figure 7. Summary information screen
Screen capture

  1. When the installation completes successfully, you will see the screen that Figure 8 shows. Select IBM Rational Performance Tester and click Finish. This will start Rational Performance Tester.

Figure 8. Installation successful notice
Screen capture

Create and run a performance test

To create a performance test to run a against an application, you use Rational Performance Tester to record a sequence of interactions with the Web-based application. This sequence is called a test scenario. You need to plan the test scenarios before you start recording. In this article, The test scenario example in this article requires the user to log into the DayTrader application, buy and sell stock, and then log out of the application.

Before recording a performance test, you also need to create the performance test project that contains the tests. Rational Performance Tester then opens a browser for you to record the test scenarios and generates the test. You can edit the generated test to add verification points, data pools, custom code, and other variables. In this example, you will add a data pool that stores multiple data for the same value. After the data pool is associated with the test, it will replace the value in the test with the data from the data pool when executing, thus simulating different user request to the server.

To run the completed test, you need to create a schedule and a user group for the test. A schedule contains one or many user groups. Recorded tests are added to the user groups. Using schedules and user groups enables control over how the tests run. For example, a test can run sequentially, randomly, or in weighted order; run at a set interval or repeatedly for a set number of times; run remotely; and emulate workload. This example uses the response time breakdown option, which is selected under the schedule, to collect statistics on a captured page element when the test runs. Response time breakdown shows how much time was spent on each page that was captured in the test. To collect the breakdown of response times, DCI monitoring must to be running.

The steps that follow will guide you from creating to running the test and generating the reports for analysis. To get started:

  1. First, start IBM WebSphere Application Server Community Edition, which will start the DayTrader application: Start > All Programs > IBM WebSphere > Application Server Community Edition > Start the server.
  2. Start Rational Performance Tester, and click OK in the default workspace location to store the test projects (see Figure 9).

Figure 9. Select the default workspace
Screen capture

1. Create a test project to store the performance tests

  1. In the Test Navigator, right-click to display the menu.
  2. Select New > Performance Test Project (Figure 10). The New Performance Test Project window will open.

Figure 10. Create a test project
Screen capture

  1. Enter the Project Name as DayTraderProject, and check Use default location (Figure 11).
  2. Click Finish to create the project.

Figure 11. Name the test project
Screen capture

2. Create a new test to record the test scenario

  1. After the project is created, the Create New Test from Recording window will open (Figure 12).

Figure 12. Create the test window
Screen capture

  1. Check Create Test from New Recording and select HTTP Recording. Click Next.
  2. For Select Location for Test Suite, select the DayTraderProject. In the Test file name field, enter DayTraderTest (Figure 13).
  3. Click Finish to start initializing the recorder.

Figure 13. Name the test
Screen capture

3. Record the test scenario against DayTrader

  1. The Rational Performance Tester recorder will open a new browser after it is initialized.
  2. In the browser, enter this DayTrader URL to bring up the application (this is the default location for DayTrader application):
    http://IIC02:8080/daytrader/app
  3. Record the following test scenario:
    1. Click the Trading & Portfolios tab.
    2. Log in, using the default user name and password (Figure 14).

Figure 14. DayTrader login screen
Screen capture

  1. When the DayTrader home page is displayed, click the Quotes/Trade link at the top to open the Quotes page (Figure 15).

Figure 15. Go to Quote/Trade page
Screen capture

  1. Click the Buy button in the first row of the Quote table to purchase 100 shares (Figure 16). The confirmation screen will confirm your purchase.

Figure 16. Purchase stocks
Screen capture

  1. Click the Portfolio link at the top to open up the user Portfolio page.
  2. Verify that the purchase is reflected in the Portfolio. On the same page, notice the number of holdings listed.
  3. Next, click the Sell link in the first row of the Portfolio table to sell the shares (Figure 17). The confirmation screen will be displayed to confirm the selling.

Figure 17. Sell stocks
Screen capture

  1. Click the Portfolio link again to see that the number of holdings reflects the sale.
  2. Click Logoff and then close the browser.

The control will return to Rational Performance Tester to process the recording and display the test content.

4. Create a data pool to replace the user ID and password value in the test

  1. In the Test Navigator, right-click to display the menu.
  2. Select New > Datapool. The New Datapool window will open (Figure 18).

Figure 18. Create a data pool
Screen capture

  1. In the Enter or select the parent folder field, enter DayTraderProject. In the Name field, enter DayTraderDatapool (Figure 19).
  2. Click Next.

Figure 19. Data pool details
Screen capture

  1. For Description, enter Datapool for the login ID, and for Initial Table Dimension, enter 2 column.
  2. Click Finish.
  3. Next, click the Variable1 column, and the Edit Variable window will open.
  4. Name the column LoginID and, for Type, enter String. Then click OK.

Figure 20. Edit variable 1
Screen capture

  1. Perform the same step as above for Variable2. Name the column Password and specify the Type as String.

Figure 21. Edit variable 2
Screen capture

The data pool will contain five different user login IDs, numbered uid:0 through uid:4, as Table 1 shows.


Table 1. User ID and Password values
User IDPassword
uid:0xxx
uid:1xxx
uid:2xxx
uid:3xxx
uid:4xxx

Tip:
To add a line for the next record, press Enter or right-click on the last record and select Add Record.


Figure 22. Add data pool record
Screen capture

Reminder:
Use CRTL-S to save the data pool.

5. Reference DayTraderTest to use the data pool value

  1. In the Test Navigator, click DayTraderTest to open the property page.
  2. Right-click DayTraderTest and select Add > Datapool.

Figure 23. Add data pool to test
Screen capture

  1. When the Import Datapool window opens, select the following:
  • Matching resources: DayTraderDatapool.datapool.
  • Open mode: Shared (per machine)
  • Wrap when the last row is reached: checked

Figure 24. Select data pool
Screen capture

  1. Click Select to accept the DayTraderDatapool.data pool for the DayTraderTest. The Test Element Details will be updated with the data pool information.

Figure 25. Data pool element details
Screen capture

  1. To save the changes, use CTRL+S.

6. Associate the user ID (uid) and password values with the data pool column

  1. In the Test Navigator, click DayTraderTest to open the property page.
  2. Expand the Welcome to DayTrader page, and then select iic02:8080/daytrader/app.

Figure 26. Select the test page
Screen capture

  1. Scroll down the Test Element Details screen until you see uid and passwd in the Data section (Figure 27).

Figure 27. Test value to associate with the data pool
Screen capture

  1. Click the uid value (highlighted in purple in Figure 28), so the menu will display, and select Substitute From > Datapool Variable.

Figure 28. Substitute value with data pool variable
Screen capture

  1. The Select datapool column window will open. Select Column:LoginID, and then click the Use Column button at the bottom (Figure 29).

Figure 29. Use data pool value
Screen capture

The uid value will be highlighted in green to indicate the association (Figure 30).


Figure 30. Associated uid value
Screen capture

  1. Repeating the steps before and after Figure 25 to associate the password value with the password column from the data pool. The password will be highlighted in green after the association, as Figure 31 shows.

Figure 31. Associated password value
Screen capture

  1. After completing the association, click the Welcome to DayTrader page again. Note that the Test Data table now contains the association (Figure 32).

Figure 32. Verify association
Screen capture

  1. To save the changes, use CTRL+S.

7. Create performance schedules

  1. In the Test Navigator, right-click DayTraderProject to display the menu, and then select New > Performance Schedule (Figure 33).

Figure 33. Create performance schedule
Screen capture

  1. The Performance Schedule window will open (Figure 34). Enter DayTraderSchedule as the name for the schedule.

Figure 34. Schedule details
Screen capture

In the Performance Schedule property window (Figure 35), under Schedule Contents, notice the DayTraderSchedule with one user group. In the Schedule Element Details, the General tab displays the Number of users as 5 by default. This is the maximum number of virtual users that you can run on the Rational Performance Tester evaluation copy.


Figure 35. Performance schedule property window
Screen capture

8. Configure the response time breakdown in the schedule for data collection

  1. In Schedule Element Details, click on the >> (double greater-than signs) to show more tabs.
  2. Click the Response Time Breakdown tab (Figure 36).
    1. Select Enable collection of response time data (Figure 37).
    2. Select DayTraderTest to perform the collection.
    3. Under Options, select High as the Detail level.
    4. The select Only sample information from a subset of users.
    5. Select Fixed number of users, and enter 2 for per User Group.

Figure 36. Response Time Breakdown tab
Screen capture


Figure 37. Response time breakdown settings
Screen capture

  1. Be sure to save the changes (CTRL+S).

The default, User Group 1, will be used to add the test. The default user group size is 100% running on the local computer (see Figure 38). In the second section of this article (Part 3), there will be steps to add more user groups as the user load test increases.


Figure 38. Default user group
Screen capture

9. Add DayTraderTest to DayTraderSchedule

  1. In the Performance Schedule property window, right-click on User Group 1, and select Add > Test (Figure 39).

Figure 39. Add the test to the schedule
Screen capture

  1. In the Select Performance Tests window, expand the DayTraderProject and select DayTraderTest (Figure 40).
  2. Click OK.

Figure 40. Select DayTraderTest
Screen capture

The test is added to the schedule under User Group 1 (Figure 41).


Figure 41. DayTraderTest added to schedule
Screen capture

  1. Use CTRL+S again to save the changes.

10. Run the DayTrader test and review the reports

  1. First, start DCI (data-conversion interface) monitoring (Figure 42). In Windows: IBM Software Delivery Platform > IBM Rational Data Collection Infrastructure > Start Monitoring.

Figure 42. Start DCI
Screen capture

  1. In the Test Navigator, right-click DayTraderSchedule to display the menu.
  2. Select Run As > Performance Schedule (Figure 43).

Figure 43. Run the performance test
Screen capture

Rational Performance Tester will launch the schedule, collect the data, and display the results in reports when the collection is finished.

  1. Scroll through the different tabs to view the reports.


Figure 44. Completed performance report
Screen capture

When you have the completed performance report, you can export a copy in HTML, XML, or CVS formats for further analysis, printing, display in the browser, or simply to share the report by e-mailing it to someone. Follow these steps to export the report to HTML:

  1. In the Performance Test Runs view, right-click the report that you want to export.
  2. Select Export To HTML from the menu (Figure 45).

Figure 45. Export the report to an HTML file
Screen capture

Note:
If you cannot see the report, right-click DayTraderSchedule and select Display Report from the menu (Figure 46).


Figure 46. Display the report
Screen capture

  1. Provide the location and file name for the report, and then click Finish (Figure 47).

Figure 47. Specify the location and the HTML file name for the report
Screen capture

  1. Open the exported report and review it on your Web browser (Figure 48).

Figure 48. Performance report in HTML format
Screen capture



Back to top


About Part 3. How to test various sizes of user loads

Now that you understand the basics, you're ready to proceed to Part 3 (see the link in Resources) to run performance tests on user loads of varying sizes.

Optional: Deploy the DayTrader sample application

  1. Download IBM WebSphere Application Server Community Edition V1.1.0.2 (see the link in Resources), and install it on the same machine where Rational Performance Tester is installed.
  2. Download IBM DB2 Express-C 9 (see Resources), and install it on the same machine where Rational Performance Tester is installed.
  3. Download the DayTrader.zip file from the Downloads section, and unzip it to your C:\ directory.
  4. Next, set up the database:
    1. In a DB2 command window, create a database called tradedb:
      Command: db2 create db tradedb
    2. Issue a connect to tradedb using db2admin:
      Command: db2 connect to tradedb user <db2admin> using <password>
    3. Load the database schema for tradedb:
      Command: db2 –tvf C:\daytrader\modules\db2\sql\Table.ddl

Figure 49. Create and configure tradedb
Screen capture

Deploy the DayTrader application into WebSphere Application Server by following these steps:

  1. Edit the C:\daytrader\plans\dayTrader-db2-9.1-XA-plan.xml file:
    1. Modify the User, Password, DatabaseName and ServerName properties for TradeDataSource.
    2. Look for these values in (shown in {brackets] in Listing 1), and change then to the correct information:
      • {db2admin}
      • {db2admin_passwd}
      • {iic02.iicmy.ibm.com}
      • {tradedb}

Listing 1. Code in the XML file
                
<name>jdbc/TradeDataSource</name>
<config-property-setting
name="User">{db2admin}</config-property-setting>
<config-property-setting
name="Password">{db2admin_passwd}</config-property-setting>
<config-property-setting
name="PortNumber">50000</config-property-setting>
<config-property-setting
name="ServerName">{iic02.iicmy.ibm.com}</config-
property-setting> <config-property-setting
name="DatabaseName">{tradedb}</config-property-setting>
<config-property-setting
name="DriverType">4</config-property-setting>


  1. Save the changes to the dayTrader-db2-9.1-XA-plan.xml file.
  2. Start WebSphere Application Server Community Edition by clicking Start > IBM WebSphere > Application Server community Edition > Start the server.
  3. Open the Windows command line, and change the directory to %WASCE_HOME%\bin.
  4. Use this command to deploy the daytrader.ear file:
    deploy.bat deploy C:\daytrader\modules\ear\target\daytrader-ear-1.1.1.ear c:\daytrader\plans\ dayTrader-db2-9.1-XA-plan.xml
  5. When prompted for the user name and password during deployment, enter system for username and manager as the password.

Figure 50. Deploy the daytrader.ear file
Screen capture

  1. When deployment completes, restart WebSphere:
  2. Start > IBM WebSphere > Application Server community Edition > Stop the server
  3. Start > IBM WebSphere > Application Server community Edition > Start the server
  4. Configure DayTrader before starting to use it:
  5. In a Web browser, open this URL: http://iic02:8080/daytrader/
  6. Click the Configuration tab, and then click (Re)-populate DayTraderDatabase.

Figure 51. Populate the DayTrader database
Screen capture

  1. A new browser will open to perform the population action. Wait until it completes before closing the browser.
  2. Notice the user IDs populated. You will use this to log in to the DayTrader application. The password for all user IDs password is xxx (Figure 52).

Figure 52. Deploy data to the tradedb database
Screen capture




Back to top


Download

DescriptionNameSizeDownload method
DayTrader sample applicationdaytrader.zip1799 KBHTTP
Information about download methods


Resources

Learn
  • Visit the IBM Rational Performance Tester InfoCenter for an index to Help topics.

  • Enroll in RT523: Essentials of IBM Rational Performance Tester V7.0. This introductory course focuses on getting started with Rational Performance Tester and practical application of the tool to resolve common performance testing challenges. Testers can build, enhance, and run scripts in a full-function Java Integrated Development Environment (IDE) that integrates with other IBM Rational Software Delivery Platform products. This live instructor-led course takes place online, with hands-on labs and real-time interactions.

  • Visit the Performance Tester area on developerWorks Rational for technical resources and best practices information on this product.

  • Subscribe to the developerWorks Rational zone newsletter. Keep up with developerWorks Rational content. Every other week, you'll receive updates on the latest technical resources and best practices for the Rational Software Delivery Platform.

  • Browse the technology bookstore for books on these and other technical topics.


Get products and technologies

Discuss


About the authors

Author photo

Allan W. Tham provides presale technical support to IBM Business Partners for IBM DB2 data warehouse, information management, and Rational software. He is also an extended member of the IBM Innovation Center, helping ISVs migrate various databases to IBM DB2 and perform load tests using the Rational testing suite. Allan earned an Honor Specialized Computer Science degree from York University, Canada, and he is a certified DB2 Content Manager designer and DB2 Universal Database administrator. Before joining IBM, he worked in a nationwide government procurement system for end users, where he was an Oracle database administrator for three years.


As a technical consultant at the IBM Innovation Center for Business Partners in Kuala Lumpur, Malaysia, Foong Yen Lee helps ISVs and other business partners integrate IBM technologies and products. Foong Yen provides in-depth technical guidance regarding porting, product validation, testing, performance tuning, technical education, and proof of concept.




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