Chapter 4: Building a Web Test Plan
Adding Users
- Simply right-click on the Test Plan icon on the left panel and select
- Add | Thread Group.
- Rename the Thread Group using a more suitable name. Let's name this Group My Users.
- For now, we will simulate the default: one-time connection and having one user (or connection/thread).
- Change the Ramp-Up Period to 0, meaning the User will start running immediately. If you have more than one user, having Ramp-Up Period 0 will cause all users to start running immediately and simultaneously.
 |
Figure 4.1.1: Adding Users
|
 |
Figure 4.1.2: Adding Users
|
Adding Default HTTP Request Properties
- Right-click the My Users element to get the Add menu, and select Add | Config Element | HTTP Request Defaults.
- Select this new element to view its Control Panel.
- Rename the Element to My URL.
- In the Server Name or IP field, enter a URL: www.example.com (or any other URL that you like to use). We will leave all other values as they are. Setting the HTTP Request Default Element will cause all other Request Sampler within this My Users to access to the same server. However, it does not make requests—it simply sets the request default for this Thread.
|
Figure 4.2: HTTP Request Default
|
Adding Cookie Support
- To add cookie support, simply add an HTTP Cookie Manager to each Thread Group in your test plan.
- This will ensure that each thread gets its own cookies, but shared across all HTTP Request objects.
- Adding Cookie Support
 |
Figure 4.3: Adding Cookie Support
|
Adding Http Requests
- Change the Name field to "Home Page".
- Set the Path field to "/". Remember that you do not have to set the Server Name field because you already specified this value in the HTTP Request Defaults element.
 |
Figure 4.4: Adding HTTP Request
|
Adding Post-Processor for Correlation
- Add a sampler.
- Right click on sampler add Pro-Processor.
|
Figure 4.5: Adding Post-Processor
|
Adding a Listener to View/Store the Test Results
- This element is responsible for storing all of the results of your HTTP requests in a file and presenting a visual model of the data.
- Add Listeners.
 |
Figure 4.6: Adding Listeners |