Skip to end of metadata
Go to start of metadata

A physical browser that accesses a website maintains application session persistence until it is closed. After the browser is restarted and navigated to the same website, a new application session will be established. A website session is controlled by one (or more) HTTP session cookies, so a new session means a new value of the cookie. In StresStimulus, a VU can either restart a browser on every iteration (the session cookie will change on every iteration), or leave the browser open across all iterations (the session cookie will stay the same on every iteration). Maintaining session persistence across all iterations can be useful when a test case has a login process that needs to be done only on the first iteration and not on subsequent iterations.

Here are two examples:

  • Internal users are signing in to the application in the morning and maintain the same session while navigating through the scenario many times throughout the day. The server renders a session cookie on the first iteration, and StresStimulus will reuse it in subsequent iterations. A login is not required in subsequent iterations.
  • On the contrary, external users who use the application occasionally are signing in every time when they need to navigate through a scenario. A new session cookie is assigned in every iteration. A login is most likely required in every iteration as well.
StresStimulus can emulate a user base that includes both of these user types. Use the VUs restarting the browser % to set the percentage of VUs that will be restarting the browser on every iteration and change the session. The rest will keep their browsers open and have their session persist across all iterations. For example, a value of 0 for VUs restarting the browser % will render session persistence for all VUs across all iterations; a value of 80 will disable session persistence across iterations for 80% of VUs and enable it for 20% of VUs.
Note: Session persistence within an iteration is always maintained.
  • No labels