...
Creating a Web Application Functional Test
In this load testing tutorial we are going to use a Parasoft-owned site named "Parabank," which is a mock banking web applicationthe ParaBank demo web application. Refer to Setting Up ParaBank for instructions on how to deploy a local instance of ParaBank.
Before you begin this lesson, we recommend that you follow the "Web Functional Testing" section section in the SOAtest tutorial to learn how to record browser test suites for use in Load Test.
...
- In SOAtest, choose File> New> Test (.tst) file.
- Enter
ParaBank
as in the File name , then click field and click Next. - Select Web> Choose Web > Record web scenario, then and click Next.Select
- Choose Record new web scenario, then and click Next.
- Complete the Record from a starting location wizard page as follows and click Finish:
- Enter
ParaBank Functional Test
in the Test Suite Name field. - Enter
http://parabank1localhost.parasoft.com/index.html
in the Start Recording From field.
Click the Finish button.
- Enter
- The test will begin , and a browser window will open. Within the browser window that opens, perform Perform the following actions in the ParaBank application:
- Type
john
for Log into ParaBank withjohn
as the username , type anddemo
for the password, then click
Log In.
- Click the the link for the first account link you see in the accounts listlisted.
Click the Sign Off link on the upper right side of the page. - Log out of the application and close the browser to Close the browser. This will conclude the recording session.
- Type
Validating the Scenario for Load Testing
...
- Switch SOAtest to the Load Test perspective by choosing Window> Open Perspective> Other> Parasoft Load Test. This will open a Load Test Explorer on the left. This is similar to the Test Case Explorer, but double clicking on each browser test case will open a special editor designed for preparing the test case step for load testing. This editor displays the various request URLs that are made by the browser to load that Web page, and any parameterized values used in these requests.
- Select the root ParaBank Test Suite node and click the Validate for Load Testing button in the tool bar. For this example, the tests should succeed, indicating that the functional web scenario is ready for load testing.
You can now configure and perform the load test as described in Creating and Performing a Load Test (for Web and/or Service Functional Tests).
...
- In SOAtest, choose File> New> Other, select Project from Existing SOAtest or WebKing Test Suites, then click Next.
- Enter
Examples
in the Project Name field. - Under Directory, specify the location of the project’s test suites by clicking Browse then navigating to
[SOAtest/Load_Test_installation_directory]/examples/tests
. - Click Finish. The Examples project will be added to the Test Case Explorer. It will contain multiple test (.tst files).
...
- Open Parasoft Load Test:
- Windows: Choose Start> Programs> Parasoft> SOAtest> Load Test.
- Linux/Mac: Change directories to the loadtest directory, then enter the following command at the prompt:
./loadtest
- In the The Welcome Wizard , select launches. Choose New Project, then and click Next.
- Select Choose SOAtest, then and click Next.
- Do one of the following:
- Services: Browse to the
ParaBank Functional Test.tst
file in your SOAtest workspace and click Next. - If you are using the SOAtestTutorial.tst file to complete this tutorial, browse to to
SOAtestTutorial.tst
andSOAtestTutorial.tst
, then click Next. If you created this from "scratch", it will be in your workspace. Otherwise, open the sample file at[Parasoft SOAtest/Load Test Install Dir]/examples/tests/SOAtestTutorial.tst
. - Web: Browse to
ParaBank Functional Test.tst
(in your SOAtest workspace), then click Next. - If Load Test detected an existing configuration, choose New Configuration.
- Services: Browse to the
- Choose the test scenario in the tree and Select the following in the tree, then click Next:
- Services: "Scenario: Test Suite: Scenario Test – Search, Place OrderAdd to Cart, and remove OrderRemove from Cart", "Test Suite: Plain XML Services".
Web: Scenario: ParaBank Functional Test.
- Services: "Scenario: Test Suite: Scenario Test – Search, Place OrderAdd to Cart, and remove OrderRemove from Cart", "Test Suite: Plain XML Services".
- Specify the following configuration In the Schedule & Distribution panel, enter 2 Minutes for the Duration, select Linear Increase for the Distribution, and click Next until screen and click Next until you reach the Other Options panel.
In screen:- Specify
2
minutes in the Duration field - Enable the Linear Increase option in the Distribution section. In order to select the Linear Increase
- option, you must have the appropriate Load Testing license. If you do not have Virtual Users enabled on your license, you will only be able to generate the Steady Load scenario.
- Specify
- In the Other Options panelscreen, enable Start Load Test immediately and Record individual hits, then options and click Finish.
Load Test will begin the specified load test. A new Load Tests tab displays in the left GUI panel and the Graph tab displays in the Load Test progress panel.
You can change the number and layout of graphs shown by right-clicking in the Graphs tab, then choosing one of the available layout options.
The load test can be stopped at any time, but we will let it run the full 2 minutes while monitoring and manipulating the in-progress details of the test.
...
After the load test is complete, a Test Information summary is displayed in the Results panel which includes the name of the project, when the load test was started and finished, the scenario you chose, as well as any machines and profiles.
You You can also choose to view different statistical reports of the load test as well. To view detailed statistics of the load test, complete the following:
- Select Statistics from the Views menu in the Results panel.
When viewing the Statistics report, an Output Types menu is available. The Output Types menu determines what type of output report is displayed. Two types of reports are available from this menu, each of which displays different columns of information. The differences between report types are:- Generic Reports: Contains Test Suite name, Test Index, Test Name, Min/Max/Avg Time (ms), Run Count, and Failure Count.
- Network Client Report: Contains all of the information in Generic Reports plus Min/Max/Avg Ping (ms), Min/Max/Avg Request Size (bytes), Min/Max/Avg Response Size (bytes) Min/Max/Avg Total Size (bytes).
- To access details about a specific test failure, double-click the related report row. You can determine whether a given test failed by locating the row that represents that test, then check-ing checking the number in that row’s Failure Count column.
...
- Double-click the Profiles folder in the Load Tests tab and select one of the available test suite nodes. The configuration panel displays on the right.
- At the bottom of the panel, change the delay Value to 3 seconds. This may simulate how a user hesitates before making a decision about ordering a book.
- Select Linear Increase beneath the Scenarios node. The Linear Increase scenario controls display in the Results panel and the User graph displays the localhost curve.
- Drag and drop the endpoint of the localhost curve to the coordinates of 10 users at 2 minutes.
- From the Vertical scale drop-down menu, select 20.
- Click the More Points button. A point will appear at the center of the localhost line.
- Click and drag the new point to the coordinates of 10 users at 1 minute.
- Expand the Linear Increase node and select the QoS node beneath it. Summary and Details tabs display.
- Select the Details tab and click the New button .
The to open the Add Metric wizard displays. - Select Statistic Metric and click Finish.
- In the metric configuration panel that opens, enter
Execution Time Requirement
in the Name field. - For the Statistic drop-down menus in the right GUI, select Avg. Exe. Time (ms) and the less than symbol (<), and then enter 200 in the text field.
This This will cause the load test result to "fail" if the execution time is measured above 200 milliseconds. For more information on configuring QoS metrics, see Customizing QoS Metrics for Scenarios. - Select the Linear Increase node beneath the Scenarios branch and click the Load Test toolbar button. Load Test will begin the customized load test and the Graph tab displays in the right GUI panel.
- Wait (2 minutes) for the load test to complete. While the load test is running, you can view various parameters within the Graph tab by selecting the appropriate checkboxes.
...
- Save this load test project by clicking the Save Project toolbar button.
- In the dialog box that opens, enter a name for the project in the File name field and click the Save button. Load Test saves the project and adds a
.lt
extension to the file name.