Why Use Independent Browser Sessions?
The Dotcom-Monitor EveryStep Recorder supports recording in multiple browser tabs. By default, every new tab that is being used by the recorder opens up in within the same session, i.e., cache and sessions are shared across all tabs.
Some monitoring and load test scenarios may require separate sessions recorded within one browser. Examples include scenarios that emulate chat conversations between two users, video or audio calls between two users, or workflows involving different user roles—such as a user submitting an application while an administrator reviews and approves it in real time.
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.
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.
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;
