The Dotcom-Monitor EveryStep Recorder supports multiple independent browser sessions within a single script. Each session runs with separate authentication, cookies, browser cache and storage, allowing you to simulate multiple users. Unlike multiple tabs in the same browser session, independent sessions do not share session data.

Use independent browser sessions when you need to simulate multiple authenticated users interacting with the same web application during a single monitoring execution or load test session. This approach is commonly used for testing real-time messaging, collaborative workflows, and cross-user synchronization scenarios.

EveryStep supports up to five independent browser sessions within a single monitoring script:

  • Session.Default
  • Session.N1
  • Session.N2
  • Session.N3
  • Session.N4

To start with editing your script, open it in the EveryScript Recorder. To learn how to switch to the Script Code editor, visit Editing a Script in EveryStep Scripting Tool.

Scripts that have been edited with custom C# code require an approval by our technical support team before being saved. Every time you add a custom C# code or edit a script that contains custom C# code the script will be sent for approval automatically. Note that it may take some time for our team to review and approve the script for use.

Create Browser Tabs in the Default Session

Use the default session when multiple tabs should behave as the same logged-in user. To create a browser tab in the default browser session:

DMBrowser tab0 = null;
tab0 = Tabs.NewTab();

This is equivalent to:

DMBrowser tab0 = null;
tab0 = Tabs.NewTab(Session.Default);

Both methods use the same default browser session.

Create Independent Browser Sessions

To create a fully isolated browser session:

DMBrowser tab1 = null;
tab1 = Tabs.NewTab(Session.N1);

Example: Multi-User Monitoring Workflow

The example below demonstrates a common real-time communication monitoring scenario:

DMBrowser tab0 = null;
DMBrowser tab1 = null;
tab0 = Tabs.NewTab(); // User A
tab1 = Tabs.NewTab(Session.N1); // User B

In this configuration:

  • tab0 can run a session under User A
  • tab1 can run a session under User B

Because the sessions are isolated, both users remain authenticated simultaneously within the same monitoring execution.

Set Cookies for a Specific Session

This can be used to initialize session-specific application state before navigation.

To set a cookie in the default session:

SetCookieForUrl("url", "key", "value");

To set a cookie for a specific session:

//Session.N1
SetCookieForUrl("url", "key", "value", 1);

Session indexes correspond to browser sessions:

  • 0 = Session.DefaultĀ 
  • 1 = Session.N1
  • 2 = Session.N2
  • 3 = Session.N3
  • 4 = Session.N4

Open URLs in Different Sessions

After creating tabs, navigate independently within each session:

//User A
Step ("Example Domain - https://example.com/");
tab0.GoTo ("https://example.com/");
//User B
Step ("Example Domain - https://example.com/"");
tab1.GoTo ("https://example.com/");

Each browser session maintains its own authentication and application state.

Working with Popup Windows

This is useful when popup windows inherit authentication or session context from the parent browser.

// Access a popup window
tab1 = Tabs.PopUps.Pop["https://the-internet.herokuapp.com/windows/new"];
// Retrieve the popup browser session
var popupSession = tab1.BrowserSession;