Presentation is loading. Please wait.

Presentation is loading. Please wait.

Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.

Similar presentations


Presentation on theme: "Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel."— Presentation transcript:

1 Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel

2 2 Day 6 Configuring JMeter Performance Test

3  Define a user group ◦ In the left panel select the Test Plan node ◦ Right-click on the Test Plan node and select: Add > Threads (Users) > Thread Groups

4  Select the User Group from the left panel  In the Right panel configure: ◦ User group name: Basic Users ◦ Number of users: 3 ◦ Ramp-Up Period: 1 ◦ Loop Count: 20

5  Copy samplers from the WorkBench into the Basic User thread group of the Test Plan. To paste the samplers into the user group, select the Basic Users node and press Ctrl + V.

6  Rename samplers, provide descriptive self-documenting names for each sampler.  Select each sampler one at a time, and change the value of the Name field for each one to descript what the sampler does.

7

8  Add Listeners to the thread group ◦ Right-click the Basic Users thread group ◦ Select: Add > Listeners > Summary Report Listener Follow the steps above to also add the Graph Results listener to the same node  Start the Test ◦ Press Ctrl + R ◦ Or choose Run > Start

9  Examine the Summary Report ◦ Observe that each request has been processed 60 times ◦ 20 loops * 3 users ◦ login.php is listed x4 so in was executed 240 = 60 x4 Note: each user performs all 7 searches per cycle

10  Right-click the Basic Users thread group  Select: Add > Logic Controller > Random Controller

11 The goal is to let the Random Controller select one out of seven available searches to execute during each cycle, instead of running all 7 searches each time.  Drag the controller up in the node tree.  Position it directly above the EmpID search.  Select whether you wish to insert the controller above or below the highlighted node.  The controller should be between login and logout requests

12  Hold down the Ctrl key and click all the search samplers  Press Ctrl + X to copy and cut all the selected samplers  Select the destination node (Random Controller) and paste.  To paste press Ctrl + V or choose Edit > Paste from the menu.

13  As we discussed in an earlier class, listeners can be added to all level of the node tree.  Listeners can be added to the thread group, to individual samplers, and to the controller. ◦ Right-click the Random Controller ◦ Select: Add > Listeners > Summary Report Listener Follow the steps above to also add the “View Results in Table” listener to the same node

14  Clear old results ◦ Press Ctrl + E ◦ Or Choose Run > Clear All  Start the Test ◦ Press Ctrl + R ◦ Or choose Run > Start  Examine the Summary Report on the Controller ◦ Observe that each search has been processed a random number of times ◦ Total of 60 searches were performed, one search per cycle Note: Total cycles = users * loops

15  Static data is problematic: ◦ May interfere with DB constraints ◦ Cached by Browser, DB, and/or Web Server thereby lessening apparent load ◦ Does not conform to “real world” behavior expectations.  Solution: Selecting data at runtime using built in functions or user specified schema.

16  The goal is to use the Random Variable configuration element to select EmpID search input value automatically for each instance of the search. ◦ Right-click the Random Controller ◦ Select: Add > Config Element > Random Variable

17  Select the Random Variable node from the left panel  In the Right panel configure: ◦ Random Variable Element Name: EMP_CODE ◦ Variable Name: Emp_Code ◦ Output format: 0000 ◦ Minimum: 1 ◦ Maximum: 12 Note: Set Options > Per Thread = true if you wish each thread to use a separate value generator

18 To reference a variable anywhere in the Test Plan use this syntax: ${variable_name}  Select the EmpID Search sampler  In the Right panel configure: ◦ loc_name: ${Emp_Code}

19  Select the View Results Tree Listened  Drag the Listener up to the EmpID Search node and release  From the menu choose Add as Child, to add he listener as a child of the sampler

20  Clear old results ◦ Press Ctrl + E ◦ Or Choose Run > Clear All  Start the Test ◦ Press Ctrl + R ◦ Or choose Run > Start  Examine the View Results Tree Listener under the EmpID Sampler ◦ Observe that each search has a random input value selected.

21  Please download a new version tomorrow


Download ppt "Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel."

Similar presentations


Ads by Google