This topic explains the think time concept used in LoadComplete and describes how you can configure a think time in your load tests.
When users navigate through pages of a web application, they usually spend some time on each page analyzing the received information or filling out forms. So, there is a pause after a user opens a page and before the user navigates to the next page. These pauses are called page think time.
There are also delays between requests that a web browser sends to download page resources (for example, images, CSS or script files) and between establishing connections through which the web browser downloads the resources. These delays are request think time and connection think time.
Think time is essential for simulating realistic user behavior and browser activity.
When you are recording a scenario, LoadComplete automatically captures a think time for web pages, connections, requests and WebSocket client and server messages. You can view and edit the recorded think time to emulate the needed behavior during the test run better.
In addition, you can also set the think time for each operation in your scenario. See Setting Delays Between Operations.
|LoadComplete treats a page’s think time as the time passed after the last request of a previous page has been completed and before the first request of the current page starts.
The page’s think time does not include the page load time; in other words, it does not affect the page load time metric.
On the contrary, a think time of requests, connections, and other page’s child operations works within the page and affects the page load time.
A page think time is the time passed after receiving a response to the last request of the preceding page and before requesting the current page. That is, in LoadComplete, the page think time is the delay at the beginning of a page, before simulating the first request of the page. You can view a page think time in the Think Time box of the operation editor when you select a page in the Scenario Explorer.
In the image below, the page think time of Page 0003 is the time after Page 0003 has been downloaded and before Page 0004 starts downloading. In other words, this is the time the user spends on Page 0003. This time is not included in the page load time of Page 0003 or Page 0004.
There are several ways to set a page think time:
Open your scenario for editing. To do this, right-click the scenario in the Project Explorer and then click Edit or double-click the scenario in the Project Explorer.
In the Scenario Explorer, select the needed page.
In the Think Time edit box at the top of the editor, enter the needed think time (in milliseconds) for the page.
Press Enter to confirm the change.
Select File | Save to save the changes.
If you select Use “think time“ values in the Select Verification Settings dialog, LoadComplete will use the specified page think time values during scenario verification.
If your load test is configured to use the think time defined in the scenario, LoadComplete will use the specified think time for all simulated virtual users during the load test run.
Typically, you verify a scenario to make sure it works correctly for one user before you start simulating it for multiple users.
To speed up the verification, you may want to omit the time a user spends on each web page, that is, to ignore the page think time:
Start verifying the needed scenario.
If the Show the “Select verification settings” message option is enabled in LoadComplete (by default), LoadComplete will show the Select Verification Settings dialog.
In the dialog, select Ignore “think time” during verification.
LoadComplete will simulate the scenario for one user ignoring the page think time. However, LoadComplete will simulate the think time values of connections, requests and other operations.
|Note:||This will not affect the actual page think time values specified in the Scenario editor. After the verification is over, the actual page think time values will remain.
To learn how to set a zero page think time in the Scenario editor, see below.
If the option is disabled, LoadComplete will always simulate the recorded think time values for pages.
A random think time for pages is a custom think time pattern that LoadComplete applies to scenarios during the test run. You enable and configure the pattern’s settings on the Think Time page of the Load Test editor. See Setting Page Think Time Behavior.
LoadComplete will use random values for all virtual users simulating the scenario during the test run. Random values will not replace the values specified in the scenario and they will not affect the scenario verification.
Use this approach to simulate a new think time for each page during the test run.
Open your scenario for editing. To do this, right-click the scenario in the Project Explorer and then click Edit, or double-click the scenario in the Project Explorer.
In the Scenario Explorer, select the request.
In the Think Time edit box at the top of the editor, enter the needed think time (in milliseconds).
– or –
Click Pages on the Scenario editor’s toolbar to group requests in the scenario by pages.
In the Scenario Explorer, select the page, to which the needed request belongs.
LoadComplete will display the page properties for editing.
In the operation properties editor, switch to the Timeline page.
Rows on the Timeline page corresponds to concurrent connections that the web browser creates for downloading web page contents (see Configuring Parallel Requests). Requests are displayed within connections to which they belong.
To change a think time for a connection, grab the connection on the page and drag it right or left.
To change a think time for a request, grab the request in the connection and drag it right or left.
|Note:||The think time of requests following the page’s first request is relative to the start of that first request.|
– or –
Click Connections on the Scenario editor’s toolbar to group requests in the scenario by connections.
In the Scenario Explorer, select the connection, to which the needed request belongs.
LoadComplete will open the connection properties for editing.
In the editor, switch to the Timeline page.
The page shows requests simulated through the connection.
To change the think time for a request, grab the request on the page and drag it right or left.
Select File | Save from LoadComplete’s main menu to save the changes.
To clear think time for an operation and its child operations quickly:
Right-click the needed operation in the Scenario Explorer, and then click Clear think time.
LoadComplete will ask whether you want to zero think time of the selected operation and its child operations. Approve the change.
Save the changes.
Now, LoadComplete will simulate operations at maximum speed.
To zero the think time just for the parent operation and keep it for child operations, select this operation in the Scenario Explorer and set 0 to its Think time property in the operation editor (see above).
We do not recommend setting think time to 0 for pages, connections, and requests as this makes the simulated load unrealistic.