Oracle® Application Testing Suite Getting Started Guide Version 9.00 for Microsoft Windows (32-Bit) Part Number E15487-01 |
|
|
View PDF |
This tutorial walks you through the main features of Oracle Load Testing for Web Applications. Oracle Load Testing for Web Applications is a separate product in the Oracle Application Testing Suite, which you may or may not have purchased. If you have the Oracle Load Testing for Web Applications version of the Oracle Application Testing Suite, you can follow the examples in this chapter to become familiar with the features and use of Oracle Load Testing for Web Applications.
The tutorial consists of the following examples:
Performing a Simple Load Test - shows how to use Oracle Load Testing for Web Applications to run virtual users to simulate load on a Web application.
Adding Data Sources - shows how to add data sources to the Oracle Load Testing for Web Applications ServerStats configuration to monitor server-side statistics, such as CPU usage, and available memory.
Editing Data Sources - shows how to edit existing Oracle Load Testing for Web Applications ServerStats configurations to modify specific counters.
Creating a Scenario with Multiple Profiles - shows how to add a new Visual Script to the Oracle Load Testing for Web Applications Scenario. This example also shows how to set the Reporting options and Session Start/Stop options to save data for use in post-run analysis.
Running Multiple Profiles - shows how to use Oracle Load Testing for Web Applications to run multiple Scenario profiles with different amounts of virtual users and how to view statistical and performance information.
Controlling Virtual Users - shows how to modify individual virtual user attributes, view actions, and stop and abort virtual users.
Generating Reports - explains how to view the default reports and generate reports for post-run analysis.
Creating User-Defined Profiles - explains how to create user-defined virtual user profiles.
The tutorial is designed to be followed sequentially from beginning to end and assumes you have completed the Oracle Functional Testing for Web Applications tutorial in Chapter 3. The examples in this tutorial refer to Visual Scripts recorded in the Oracle Functional Testing for Web Applications tutorial.
This example shows how to use Oracle Load Testing for Web Applications to run virtual users to simulate load on a Web application. The example illustrates how to run a previously recorded Visual Script to simulate multiple users accessing a Web application.
Select Programs from the Start menu and then select Oracle Load Testing for Web Applications from the Oracle Application Testing Suite submenu to start Oracle Load Testing for Web Applications.
Figure 5-1 Oracle Load Testing for Web Applications Main Window
Enter your user name and password to log in.
Select RSWDemo in the Workspace list.
Make sure the Build Scenario tab is displayed in Oracle Load Testing for Web Applications.
Select tutor1 in the Select scripts list. These are the Visual Scripts that you record using Oracle Functional Testing for Web Applications.
Click the Add to scenario button to add tutor1 to the Configure Parameters list. You can also double-click the script name to add it to the Configure Parameters list.
Oracle Load Testing for Web Applications automatically specifies a set of default virtual user attributes for the Scenario Profile in the Scenario tab. For this example, we'll use the default attributes.
Click the Add to Autopilot button on the Build Scenario tab.
Oracle Load Testing for Web Applications automatically opens the Set up Autopilot tab with the tutor1 Scenario Profile listed in Submitted Scenario Profiles list.
Select After each user plays [#] iteration option from the Stop the load test group of the Autopilot tab.
Enter 5 in the After each user plays edit box.
Select [#] users below Add per step in the Virtual User ramp up group.
Enter 1 in the Add per step [#] users edit box.
Select [#] seconds below After every in the Virtual User ramp up group.
Enter 10 in the [#] seconds edit box.
Click the Run Test button on the Autopilot tab or the toolbar.
Select Yes when asked to record session data and click OK.
Oracle Load Testing for Web Applications starts running the virtual users in the Virtual User Grid. Watch as the Autopilot starts running the tutor1 Visual Script as ten virtual users.
Figure 5-4 Virtual User Status Grid Window
Allow the virtual users to continue running until all of them indicate Finished in the Status column of the virtual user grid.
Congratulations. You have just performed a simple load test on the Demo Web application. Oracle Load Testing for Web Applications performs the virtual user Web interaction in the background. You can monitor the virtual users in the grid as they are running. In the later examples of this tutorial, you'll see how to use Oracle Load Testing for Web Applications to view statistical and performance information, and how to view virtual user actions.
This example shows how to add data sources to the Oracle Load Testing for Web Applications ServerStats configuration to monitor server-side statistics, such as CPU usage, and available memory.
Oracle Load Testing for Web Applications ServerStats can monitor statistics from a variety of systems and server types. This tutorial adds counters from your local Windows 200x/XP system to demonstrate the features of Oracle Load Testing for Web Applications ServerStats. If you are not running the Oracle Application Testing Suite on a Windows 200X/XP machine, you should skip examples two and three and continue the tutorial with example 4.
To configure counters from a Windows 200x/XP data source, do the following:
Select Configurations from the ServerStats menu. Oracle Load Testing for Web Applications opens the ServerStats Configurations window.
Click New to add a new configuration.
Type Tutorial for the Name and the Description.
Click Save. The Configuration window changes to include the Monitors configuration options.
Click New in the Monitor pane to open the Add Monitor Step 1 window.
Figure 5-6 Add Monitors Step 1 Dialog Box
Click the Plus icon next to Data Sources to expand the list of data sources.
Figure 5-7 Add Monitors Step 1 with Data Sources Expanded
Select Perfmon (Windows Performance Monitor) and click Next.
Figure 5-8 Add Monitors Step 2 Dialog Box
This step lets you specify which to monitor and which system to use for the data collector.
Leave the default settings for Monitored System and Data Collector.
Click Next to select the specific counters to monitor.
Figure 5-9 Add Monitors Step 3 Dialog Box
Select Processor in the Performance object list.
Figure 5-10 Add Monitors Step 3 with Processors Listed
Select % Processor Time in the Select counters from list group.
Click Add. The counters are added to the Counters list.
Figure 5-11 Add Monitors Step 3 with Processors Selected
Select Memory in the Performance object list.
Select Available Kbytes and click Add.
Figure 5-12 Add Monitors Step 3 with Processors and Memory Selected
Click Finish to complete adding monitors. ServerStats display a status while it verifies the counters (this may take a few moments).
When the verification is complete, the Configuration window is updated with the list of monitors.
Figure 5-13 Configurations Dialog Box with Defined Monitors
Review the results to verify the counters are working properly.
Click Close to exit the test results.
The next example explains the procedures for editing existing ServerStats configurations.
This example shows how to edit existing Oracle Load Testing for Web Applications ServerStats configurations to modify specific counters. The steps in this example are based upon steps completed in the previous example.
If not already open, select Configurations from the ServerStats menu to open the ServerStats Configurations window.
Select the Tutorial configuration.
Click the Memory (Available Kbytes) monitor and click Edit.
Click Add next to Monitored System.
Figure 5-16 Add Monitored System Dialog Box
If you have additional systems to monitor you can specify the information here to add the system to the ServerStats Configuration.
Click Cancel.
Click OK.
Click Close to close the ServerStats Configurations window.
See the Oracle Load Testing for Web Applications User's Guide for additional information about using the features and options of Oracle Load Testing for Web Applications ServerStats.
This example shows how to create scenarios with multiple virtual user profiles and how to set the attributes for each scenario. It also shows how to specify the reporting options.
Click the Build Scenarios tab.
Double-click tutor3 in the Default Profiles list to add it to the Configure parameters of the scenario list.
Click the Configure all parameters button on the tutor3 line to display the Edit Scenario Details dialog box.
Change the #VUs value to 3.
Make sure the Virtual User Pacing is set to Recorded and the Maximum value is set to 1 second.
Leave the default settings for remainder of the attributes and click OK.
Click the Configure all parameters button on the tutor1 line to display the Edit Scenario Details dialog box.
Make sure the Virtual User Pacing is set to Recorded and the Maximum value is set to 1 second and click OK.
Notice that each profile in the Scenario Profiles list can have a different set of attributes.
The data generated by a Oracle Load Testing for Web Applications Autopilot session can be saved to the Oracle Load Testing for Web Applications database for post-session analysis. The Session Start/Stop options let you specify if Oracle Load Testing for Web Applications should save the data.
Select Options from the Tools menu and then select Session Start/Stop.
Figure 5-17 Session Start/Stop Options Dialog Box
Select Scenario Defaults.
Figure 5-18 Scenario Defaults Options Dialog Box
Scroll down the screen and set Auto generate timers for all resources in the Reporting section to True.
Click OK.
This example shows how to use Oracle Load Testing for Web Applications to run multiple Scenario profiles with different amounts of virtual users and how to view statistical and performance information.
Make sure the Scenario from the previous example is still shown in the Build Scenarios tab.
Click the Add to Autopilot button on the Scenario tab or the toolbar.
Oracle Load Testing for Web Applications automatically opens the Set Up Autopilot tab with the tutor1 and tutor3 Scenario Profiles listed in Submitted Scenario Profiles list.
Select When the stop button is pressed in the Stop the load test group of the Set Up Autopilot tab.
Enter 3 in the edit box next to # users under Add per step in the Virtual User (VU) Ramp-up section.
Enter 5 in the edit box next to # iterations under After every in the Virtual User (VU) Ramp-up section.
In ServerStats Configuration section, select Tutorial from the Configuration drop down list to add the configuration to the load test.
Click Save to save the Rampup Specification in the Scenario file.
Click the Run test button on the Oracle Load Testing for Web Applications toolbar.
Oracle Load Testing for Web Applications opens the Save Session data dialog box.
Click Ok.
The Save Session data dialog box appears because we used the Ask setting in the Session Start/Stop options (select Options from the Tools menu). You can bypass this dialog box and use automatic or default values when running virtual users under routine testing conditions by changing the Session Start/Stop options.
Watch as the Autopilot starts running the tutor1 and tutor3 Visual Scripts as virtual users. Notice also that tutor3 is playing back records from the Data Bank.
Initially, the Autopilot starts only three virtual users. After the first three have completed five iterations, the Autopilot starts another three virtual users. Once the second three virtual users have completed five iterations, the remaining three virtual users start. The Virtual User (VU) Ramp-up options of the Autopilot let you control the rate at which virtual users start running.
Oracle Load Testing for Web Applications automatically displays run time graphs in the View Run Graphs tab. Scroll to the bottom of the window until you see the Performance Statistics icon.
Click on the icon to view the Performance Statistics report. The Performance Statistics window shows a summary of the performance data for the running virtual users.
Figure 5-22 Performance Statistics Report
The statistics show the values for the following performance categories:
Active Virtual Users - the number of virtual users currently running in the Autopilot.
Virtual Users with Errors - the number of virtual users with errors.
Transactions Per Second - the number of times the virtual user played back the Visual Script per second.
Pages Per Second - the number of pages returned by the server per second. A "page" consists of all of the resources (i.e. page HTML, all images, and all frames) that make up a Web page.
Hits Per Second - the number of resource requests to the server per second. Each request for a page, individual images, and individual frames is counted as a "hit" by Oracle Load Testing for Web Applications. If Oracle Load Testing for Web Applications does not request images from the server (as specified in the Download Manager), images are not included in the hit count. The Hits Per Second and Pages Per Second counts will be the same if images are not requested and there are no frames in the page.
Kilobytes Per Second - the number of kilobytes transferred between the server and browser client per second.
<Session Name> Totals
Transactions - the total number of times the virtual user played back the virtual user profile.
Transactions with Errors - the total number of virtual user profile iterations that had errors.
Pages - the total number of number of pages returned by the server.
Kilobytes - the total number of kilobytes transferred between the server and browser client.
Performance by Profile and Timer
<Profile Name> - the latest, minimum, maximum, and average performance for the virtual user profile in seconds.
<Timer Name> - the latest, minimum, maximum, and average performance for the server response timers in seconds. Server Response timers are added to Visual Scripts using Oracle Functional Testing for Web Applications.
Performance by Profile and VUs
<Profile Name> # VUs - shows the time it took to run the virtual user profile with the indicated number of virtual users running. When ramping up virtual users, Performance by Profile and VUs values are added when additional virtual users start running. Once additional Performance by Profile and VUs values are added, the previous Performance by Profile and VUs values are no longer updated. For example, the statistics show elapsed time values for each profile for three, six, and nine virtual users. The <profile name> 3 VUs values are updated only while three virtual users are running. Once the Autopilot ramps up to run six virtual users, the <profile name> 3 VUs values stop updating and the <profile name> 6 VUs values are added and are updated while six virtual users are running. Once the Autopilot ramps up to run nine virtual users, the <profile name> 6 VUs values stop updating and the <profile name> 9 VUs values are added and are updated while nine virtual users are running.
Click the Overview tab in the View Run Graphs tab.
Oracle Load Testing for Web Applications provides several types of graphs that show performance, error, and statistical information for the running virtual users. Click on the graph in the Overview tab to view a larger image in the Default Graphs tab.
Select the Performance Vs. Users in the View dropdown of the Default Graphs tab.
This graph shows the average run time for the number of running virtual users in each profile. The plot points represent the Autopilot rampup of virtual users. In the above graph, the first plot points for each profile shows the average run time while three virtual users were running. Once the Autopilot ramps up to run six virtual users, the plot points for three virtual users are no longer updated.
The second plot points show the average run time while six virtual users were running. Once the Autopilot ramps up to run nine virtual users, the plot points six virtual users are no longer updated.
The third plot points show the average run time while nine virtual users are running. In this example, nine virtual users is the total number of virtual users the Autopilot ramps up to run. The third plot points will be updated continuously while the nine virtual users are running.
Select the Users Vs. Time in the View dropdown of the Default Graphs tab.
This graph shows the relative time when the virtual users for each profile started running. The graph represents the Autopilot ramp up times and the number of virtual users ramped up for each profile.
Select the Performance Vs. Time in the View dropdown of the Default Graphs tab.
This graph shows the average run time for the active virtual users running each profile over time.
Select the Statistics Vs. Time in the View dropdown of the Default Graphs tab.
This graph shows averages for virtual user hits, pages, transactions, and Kilobytes per second over time.
The error graphs show percentages of errors vs. virtual users over time.
This example shows how to modify individual virtual user attributes, view actions, and stop and abort virtual users in Oracle Load Testing for Web Applications.
Make sure the virtual users from Example 3 are still running.
Click on any virtual user in the virtual user grid.
Click the right mouse-button to open the popup menu.
Select Modify Run Attributes. Oracle Load Testing for Web Applications opens a dialog box for changing the run attributes for the selected virtual user.
Figure 5-28 Modify Run Attributes Dialog Box
You can change the attributes of each virtual user individually.
Click Cancel to close the dialog box.
Select VU Display from the Tools menu or you can also use the right-click popup menu from the virtual user grid. Oracle Load Testing for Web Applications opens a browser window in which you can view the actions of the virtual user.
Click the Navigate to Previous Page toolbar button. The viewer shows only the previous page.
Click the Navigate to Next Page toolbar button. The viewer shows only the next page.
Click the Auto Mode toolbar button. The view shows new pages accessed by the virtual user as they arrive to the viewer.
Click the Stop Accepting New Pages toolbar button. The viewer stops accepting pages from the virtual user.
Note: Because of the speed at which new pages arrive in the viewer, it may take a few moments for cached pages to stop appearing.
Close the window to exit the viewer.
Click on any virtual user in the virtual user grid.
Click the right mouse-button to open the popup menu.
Select Stop. Oracle Load Testing for Web Applications stops running the selected virtual user. The virtual user will complete the current Visual Script iteration and then stop.
Click on any virtual user in the virtual user grid.
Click the right mouse-button to open the popup menu.
Select Abort. Oracle Load Testing for Web Applications aborts running the selected virtual user without completing the current visual script iteration.
This example explains the automatic report generation features of Oracle Load Testing for Web Applications. The data collected by Oracle Load Testing for Web Applications and Oracle Load Testing for Web Applications ServerStats while the Autopilot is running virtual users is saved to a database when the Save Data for Reporting option in the Oracle Load Testing for Web Applications Session Start/Stop options is set to Yes or Ask. You can use Oracle Load Testing for Web Applications to analyze the data and generate a variety of graphs and reports.
This example shows how to use previously saved data to create custom reports and to view Session and Scenario reports.
Select the Create Reports tab.
The Graph 1 tab is displayed with a blank graph. Select Session0001 from the Session list. The data categories appear in the Available Data Series list.
Click Show All.
Double-click Hits/Sec, kb Rcvd/Sec, Pages Rcvd/Sec, and Trans/sec at the top of the Available Data Series field to add the counters to the graph. These are the overall counters. You can also select them and click the Add Data Series button.
Expand the ServerStats Monitors node then double-click the Oracle Load Testing for Web Applications Server (Processor, % Processor Time, 0) node to add it to the graph.
The legends show which color line represents which virtual user profile, Visual Script page, and Oracle Load Testing for Web Applications ServerStats counter. The legends for Oracle Load Testing for Web Applications data show the session, the virtual user profile, and the Visual Scripts page in the form session.profile.page[#]. The legends for ServerStats data show the session, counter object, counter instance and counter in the form session.object.instance.counter.
You can export the data to an HTML file, a comma separated value file, or a Microsoft Excel Workbook file.
Note: Skip this section if you do not have Microsoft Excel installed on your system.
Click the Export to Excel button.
The File Download dialog box is displayed. Click Save.
The Save As dialog box is displayed. Select a location to save the report and click Save.
The Download Complete dialog box is displayed. Click Open.
The workbook contains a chart sheet and a worksheet. You can use the features and capabilities of Microsoft Excel to change the chart format.
Click the Data Table tab to view the actual data values.
Figure 5-33 Sample Excel Data Table Report
Row one contains the counter names. Subsequent rows contain the actual data values for the chart.
Select Exit from the File menu to close Microsoft Excel.
The report shows the current and total performance over time for the Oracle Load Testing for Web Applications scenario. The report also shows the Oracle Load Testing for Web Applications scenario settings used for the session.
Oracle Load Testing for Web Applications also generates textual reports for Oracle Load Testing for Web Applications Scenario settings and Oracle Load Testing for Web Applications and Oracle Load Testing for Web Applications ServerStats session data.
Select the Reports tab.
Select the session for which you want to view the report from the Session dropdown list and click Generate. Oracle Load Testing for Web Applications displays the report.
Figure 5-34 Sample Session Performance Report
Scroll to the end of the Session Performance Report to view the Oracle Load Testing for Web Applications Scenario Report.
You can print the report by clicking the Print Friendly button and selecting Print from the File menu in the browser window.
This example explains how to create user-defined virtual user profiles in Oracle Load Testing for Web Applications.
Select User Defined Profiles from the Manage menu. Oracle Load Testing for Web Applications opens a dialog for managing profiles.
Click New.
Figure 5-35 Edit User Defined Profiles Dialog Box
The dialog box shows the section tree, the available Visual Scripts, and the default synchronization points.
Select the workspace where you want to save the profile and enter a name for the profile in the Name editbox.
The profile sections tree allows you to specify which Visual Scripts and synchronization points to include in the Sections tree of the profile.
Prolog - the Visual Scripts in this section play back only once at the beginning of the Scenario run. An example of what you may add to this section is a login script.
Run - the Visual Scripts in this section iterate over as many times as is specified in the Autopilot. An example of what you may add in this section is the business transaction that you wish to load test.
Epilog - the Visual Scripts in this section play back only once at the end of the Scenario run. An example of what you add to this section is a logoff script.
Errors - the Visual Scripts in this section play back only if an error occurs during the Scenario run. An example of what you may add to this section is a visual script that resets your application on an error.
Select the section in the tree where you want to add a Visual Script.
Double-click the Visual Script to add to the section or select the script and click the Add button.
The Visual Script appears as a node of the tree.
Figure 5-36 Script Added to Run Section of User Defined Profile
Repeat steps 4 and 5 to add additional Visual Scripts to the Sections tree.
A sync point allows multiple virtual users to synchronize their actions and interactions with the application under test. Sync points provide the ability to create realistic multi-user situations that may expose resource conflicts such as deadlocks. When you specify a sync point, multiple virtual users executing the script will reach this sync point at various times depending on a number of factors (for example, the speed of the machine).
Sync points cause each virtual user to wait until all virtual users have reached that sync point. Each of the virtual users notifies the master upon reaching the sync point. The master waits for all of the virtual users to notify it and then issues the go-ahead for all the virtual users to continue past that sync point.
Select the section in the tree where you want to add a Sync point and click Add Sync.
The Sync point appears as a node of the tree.
Figure 5-37 Sync Point Added to Run Section of User Defined Profile
Repeat steps 7 and 8 to add additional Sync points to the Sections tree.
When you have multiple items under any section of the tree, you can move the items up and down within that section.
Select the item to move in a section.
Click the up or down button as appropriate.
Figure 5-38 Edit User Defined Profile Dialog Box
Click the OK button when you finish defining the profile.
The new profile appears in the Select scripts and user-defined profiles list of the Build Scenarios tab.
Figure 5-39 Select Scripts and User-Defined Profiles Pane
You can include user-defined profiles as part of the Scenario Profiles the same way you use the default profiles.
After you have created a user-defined virtual user profile, you can make changes to the profile at any time.
Select User Defined Profiles from the Manage menu.
Figure 5-40 User Defined Profile Manager Dialog Box
Select the profile you want to edit and click Edit. Oracle Load Testing for Web Applications opens a dialog for editing the sections tree of the profile. The dialog box shows the current sections tree, the available Visual Scripts, and the default synchronization points.
Figure 5-41 Edit User Defined Profile Dialog Box
Click the Plus icon to expand the nodes of the tree.
Use the arrow buttons as necessary to add items to the sections of the tree. Select an item and click Delete to remove it from the sections tree.
Click the OK button when you finish editing the profile.
Select Exit to close Oracle Load Testing for Web Applications.
Click No if asked to save the scenario.
This completes the Oracle Load Testing for Web Applications tutorial. See the Oracle Load Testing for Web Applications User's Guide for additional information about load testing and using Oracle Load Testing for Web Applications.