Load Test Validation

This tutorial provides a brief introduction to the validation of an AppPerfect Load Test using a set of hands-on practice exercises. This tutorial assumes you have successfully downloaded and installed AppPerfect Load Test on your machine with the default options. Apart from this pre-requisite, this tutorial is self contained. Instructions given below are Windows-specific; if you are using a non-Windows machine, please use equivalent commands/instructions.

This document is divided into following sections

  1. Creating Project
  2. AppPerfect Load Test

Within each section, multiple exercises are listed. Each exercise forms a logical unit which is expected to take no more than a few minutes to perform. All exercises use the PetStore demo application running inside Apache Tomcat. The modified PetStore application and Tomcat are both bundled with this product.

All exercises assume you have installed the product in C:\AppPerfect\LoadTest folder and will be referred as LOADTEST_HOME henceforth in tutorial. If you have installed the product in some other folder, modify the instructions below appropriately.

This tutorial is not intended as a comprehensive training guide. Please refer to the product documentation for detailed information. However, this tutorial will give you a very good overview of the products and substantially improve your productivity with the product.

Creating Project

Exercise 1: Launch AppPerfect Load Test

  1. Click on Start -> Programs ->AppPerfect Load Test x.x.x -> AppPerfect Load Test
  2. On launching AppPerfect Load Test a Welcome page will be displayed. Go through the brief description given for product.
    NB: Welcome page is displayed only when Load Test x.x.x is launched and last time no project was opened.

Exercise 2: Creating a Project

  1. Launch the Project Wizard by clicking File ->New... menu option. The New Project wizard will be launched.
  2. Keep the default project name and location for the purpose of this exercise. Click on the OK button.
  3. A confirmation message saying that the project is saved will be displayed. Click on the OK button.

Now using this project we will create tests to demonstrate the functionalities of AppPerfect Load Test product.

AppPerfect Load Test

NB: Please follow the steps provided in the "Creating Project" section to first create a project, then proceed further.

Exercise 1: Define a Load Test project

  1. Once the project is successfully created another dialog - Define Project Properties dialog - will be displayed.
  2. Change the default settings as shown in this dialog as Test Duration:1min, Load Type:Loop, Loop Count:2, Virtual Users:1.
  3. Go through the description given for Loop load type at the bottom.
  4. Review other settings in the Panel and click on the OK button to close this dialog.
  5. Click through all the menu items to familiarize yourself with the available features and how to access them. Viewing through all menu items will give a reasonable overview of the application.
  6. Click Help -> Table of Contents menu item to see AppPerfect Load Test product documentation
  7. Open the Preferences dialog by selecting the menu option Tools -> Options...
  8. Review the default settings for Load Test and click the OK button to close the dialog.

Exercise 2: Recording a Test

  1. Start tomcat server by selecting Start->Programs->AppPerfect Load Test x.x.x->Documentation and Examples->Examples->Tomcat running Petstore->Start Server.
  2. To start recording, click on Project -> Record test... in the menu bar.'
  3. 'Record a test' dialog will be displayed. Select ActionGroup1 from the Group combo. Provide starting URL as "http://localhost:8396/petstore". In the authentication select "No Authentication". Click on 'Start recording' button to start recording test.
  4. An instance of configured browser will be launched with the PetStore home page loaded. Click on enter the store link. This will populate the database and display the PetStore main page. Note that populating the database might take some time.
  5. Order an item by clicking on: Birds -> Amazon Parrot -> Adult Male Amazon Parrot -> Add to cart
  6. Check out by clicking on the Check Out link.
  7. At the 'Sign in' page, default values are already provided. Click on Submit.
  8. Sign out of PetStore by clicking on Sign-out at top right of screen.
  9. Close browser by clicking on File -> Close in the browser window.
  10. Click on the Stop button of "Record a test" dialog to stop the recording session.
  11. Click on Close button to close the 'Record a test' dialog.
  12. The URLs navigated will be displayed under ActionGroup1.
  13. Click through each Tasks to view its details on the panel on the right.

Exercise 3: Configuring Parameters in Test

  1. In the editor tree, select 'Parameters' to open the parameters settings table on the right hand side.
  2. Here, click on 'Add Parameter' button to add a parameter.
  3. Select 'Fixed Values' as Data Source. Select Next button.
  4. In the 'Parameter Setting Dialog', enter 'userParam' as the parameter name.
  5. Under Add Value, enter j2ee and click on the 'Add' button.
  6. Under Add Value, enter john and click on the 'Add' button.
  7. Choose 'Sequential' as parameter selection.
  8. Click Finish.
  9. In the editor tree select the task which states something like 'Task20 [/petstore/checkhimout.do]'.
  10. Select 'Post Parameters' tab.
  11. Click on the parameter name 'userName1' in the parameters table.
  12. Click on the 'parameterize' button.
  13. In the parameterization settings dialog, select 'userName1' under the name column in the parameter settings table.
  14. On selection, in the value group, 'Constant' will be selected with the value j2ee in the text box.
  15. Select 'Parameterize' and from the combo box, select userParam. This will use the values of userParam as username on each iteration.
  16. Click Finish.

Exercise 4: Configuring Text Validation

  1. In the editor tree select the task which states something like 'Task21 [/petstore/mainscreen.do]' after the task 'Task20 [/petstore/checkhimout.do]'.
  2. Select Validation tab on the right hand side. Right click on it and select 'Add Validation' in the pop-up menu.
  3. This will bring up the 'Define Validation' dialog.
  4. Select Text validation option. Select Next button
  5. Under description enter 'userNameText'.
  6. Under 'Check for', select 'Exact match' and enter j2ee.
  7. Click Finish. What this basically does is that when this page loads (on replaying), it will search the page for the text j2ee and if it is not found, the validation will fail. Since we have parameterized the username, on the 2nd iteration, the username passed will be john which does not exist. As a result of which, this page will not replayed as expected and the validation will fail.

Exercise 5: Configuring Element Attribute Validation

  1. In the editor tree select the task which states something like 'Task17 [/petstore/newLogin.jsp].
  2. Select Validation tab on the right hand side. Right click on it and select 'Add Validation' in the pop-up menu.
  3. This will bring up the 'Define Validation' dialog.
  4. Select Element Attribute validation option. Select Next button
  5. Expand the tree and select the element 'userName1' which will highlight the 'UserName' text box under 'Are you a returning customer - Yes'.
  6. Select Next button.
  7. Check 'Validate' for the row whose property name is 'value' and property value is 'j2ee'.
  8. Click Finish.
  9. Select the 'Validation' tab below. In the validation table, select the validation just added and click 'Parameterize..' button.
  10. This will bring up the 'Parameterization Settings Dialog'. Here change the constant value from j2ee to john.
  11. Click Ok.
  12. What this basically does is that when this page loads (on replaying), it will confirm the value in the text box with john. Since in both our iterations, the initial value (when the page loads) will be j2ee, the validation will fail in both iterations.

Exercise 6: Executing a test

  1. To execute the test, click on Project -> Run from the menubar.
  2. The focus will be shifted to Status tab. Here the current status of the test execution will be displayed. Various test metrics such as response time, virtual user count, etc. are continuously refreshed in the charts.
  3. The test will run for 1 minute as specified when project was created.
  4. Stop running tomcat server by selecting Start->Programs->AppPerfect Load Test x.x.x->Documentation and Examples->Examples->Tomcat running Petstore->Stop Server.

Exercise 7: View and analyze result

  1. Once the test is completed, the test results will be displayed in the "Results" tab and result summary data is displayed in the main window on the right.
  2. Since we configured the validation to fail, the result of our test execution was "Failed". Additional details about failed hits can be found by clicking "View Failed Hits" button in task detail results view.