AppPerfect Load Tester 


Tutorial : Parameterizing A Load Test

This tutorial provides a brief introduction to the parameterization of a Load test using a set of hands-on practice exercises. This tutorial assumes you have successfully downloaded and installed AppPerfect Test Studio 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 Common Project
  2. AppPerfect Load Tester

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\TestStudio folder and will be referred as TESTSTUDIO_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 Common Project

In AppPerfect Test Studio, you can create a common project and use the same project to perform tests in all the bundled products.

Exercise 1: Launch AppPerfect Test Studio

Action:

  1. Click on Start -> Programs ->AppPerfect Test Studio x.x.x -> AppPerfect Test Studio
  2. On launching AppPerfect Test Studio a Welcome page will be displayed. Go through the brief description given for each product and click on the product icon to view its perspective.
    NB: Welcome page is displayed only when Test Studio x.x.x is launched and last time no project was opened.
  3. To switch between different product perspectives click on corresponding project button in toolsbar.

Exercise 2: Creating a Common Project

Action:

  1. Launch the Common 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. We don't have to provide "Notification" settings. 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 common project we will create tests to demonstrate the functionalities of AppPerfect Load Tester product.

AppPerfect Load Tester

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

Exercise 1: Define a Load Tester project

Action:

  1. Once the common 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, Run Type:Loop, LoopCount:3, Virtual Users:1.
  3. Go through the description given for Loop run 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 Test Studio product documentation
  7. Open the Preferences dialog by selecting the menu option Tools -> Options...
  8. Review the default settings for Load Tester and click the OK button to close the dialog.

Exercise 2: Creating required parameters

To demonstrate parameterization, we will consider the "Account" page of Petstore which has a login page that takes a user name and a password. For this we will be defining three different parameters values each for login and password to be used while replaying the test.

Action:

  1. Start tomcat server by selecting Start->Programs->AppPerfect Test Studio x.x.x->Documentation and Examples->Examples->Tomcat running Petstore->Start Server.
  2. In IE, enter the URL to load the petstore app. i.e. "http://localhost:8080/petstore"
  3. Click on link "enter the store".
  4. Click on link "Account".
  5. Here, Under "No. I would like to sign up for an account.", create three user accounts. For this tutorial we'll assume the following three user accounts:
  6. We shall be leaving default information for "Contact Information" on submitting the new username and password. Sign-out and repeat process to add all the usernames and passwords.

  7. Finally sign-out and close the browser.

Exercise 3: Recording a Test

Action:

  1. To start recording, click on Project -> Record test... in the menu bar.'
  2. 'Record a test' dialog will be displayed. Select ActionGroup1 from the Group combo. Provide starting URL as "http://localhost:8081/petstore". In the authentication select "Form based Authentication" and provide user name: "john" and password :"smith". Now Click on 'Start recording' button to start recording.
  3. An instance of Microsoft Internet Explorer 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.
  4. Order an item by clicking on: Birds -> Amazon Parrot -> Adult Male Amazon Parrot -> Add to cart
  5. Check out by clicking on the Check Out link.
  6. At the 'Sign in' page, under "Are You a returning customer - Yes.", enter username as john and password as smith. Click on Submit.
  7. Sign out of PetStore by clicking on Sign-out at top right of screen.
  8. Close browser by clicking on File -> Close in the browser window.
  9. Click on the Stop Recording button of "Record a test" dialog to stop the recording session.
  10. Click on Close button to close the 'Record a test' dialog.
  11. The URLs navigated will be displayed under ActionGroup1.
  12. Click through each Tasks to view its details on the panel on the right.

Exercise 4: Configuring Parameters in Test

Action:

  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. In the 'Parameter Setting Dialog', enter 'userParam' as the parameter name.
  4. Select 'Fixed Values - Fetch value from list of fixed values provided' as Data Source.
  5. Choose 'Sequential' as parameter selection.
  6. Under Add Value, enter john and click on the 'Add' button.
  7. Under Add Value, enter sam and click on the 'Add' button.
  8. Under Add Value, enter pet and click on the 'Add' button.
  9. Click Ok.
  10. Click on 'Add Parameter' button to add another parameter.
  11. In the 'Parameter Setting Dialog', enter 'passParam' as the parameter name.
  12. Select 'Fixed Values - Fetch value from list of fixed values provided' as Data Source.
  13. Choose 'Sequential' as parameter selection.
  14. Under Add Value, enter smith and click on the 'Add' button.
  15. Under Add Value, enter bradley and click on the 'Add' button.
  16. Under Add Value, enter shop(a wrong password as per the user account we created for username pet, the correct password was "store") and click on the 'Add' button.
  17. Click Ok.
  18. In the editor tree select the task which states something like 'Task N [/petstore/checkhimout.do]'.
  19. Select parameters tab.
  20. Click on the parameter name 'userName1' in the parameters table.
  21. Click on the 'parameterize' button.
  22. In the parameterization settings dialog, select userName1 under the name column in the parameter settings table.
  23. On selection, in the value group, 'Constant' will be selected with the value john in the text box.
  24. Select 'Parameter' and from the combo box, select userParam. This will use the values of userParam as username on each iteration.
  25. In the parameterization settings dialog, select passWord under the name column in the parameter settings table.
  26. On selection, in the value group, 'Constant' will be selected with the value smith in the text box.
  27. Select 'Parameter' and from the combo box, select passParam. This will use the values of passParam as the password on each iteration.
  28. Click Ok.

Exercise 5: Executing a test

Action:

  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 3 loop counts as specified when project was created.
  4. Stop running tomcat server by selecting Start->Programs->AppPerfect Test Studiox.x.x->Documentation and Examples->Examples->Tomcat running Petstore->Stop Server.

Exercise 6: Checking Parameterization

Action:

  1. Before excuting the test, open the Preferences dialog by selecting the menu option Tools -> Options...
  2. Go to Log Settings and Select "Log Requests Fired" checkbox. Click on OK to save and close the dialog.
  3. After the excution of test go to "TESTSTUDIO_HOME/logs" folder and look for "request.txt" file.
  4. Open "request.txt" file in some editor and check the requests fired. Search for request "checkhimout.do" and check the parameters passed, you can see that during each run a different parameter value was passed to the server.