Why Use Independent Browser Sessions?
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 recording in multiple browser tabs. By default, all tabs in a recording share one browser session. They share cookies, cache, and storage. To record two users at the same time, for example a customer and an administrator, record each user in a separate session. Sessions do not share data.
The EveryStep Recorder supports up to five sessions:
- Session.Default
- Session.N1
- Session.N2
- Session.N3
- Session.N4
You can create independent browser sessions in the recorder or in the script code.
Record Isolated Sessions in the EveryStep Recorder
- Start a recording. Record the steps for the first user in the first tab.
- In the top toolbar, select Recorded Tabs. The number on the button shows how many tabs are open.
- Select New Session.
- Enter the URL in the address bar. Record the steps for the second user.
- To add more sessions, repeat steps 2 to 4. A script supports up to five sessions.
- Select Stop and save the script.
Switch Between Tabs and Sessions
To switch between tabs and sessions:
- In the top toolbar, select Recorded Tabs.
- Select the tab card to record in. The recorder will open the selected tab.
- Record the steps.
The recorder adds the steps to the script for the selected tab.
Review the Generated Script
The recorder writes the session code for you. To review it while recording, click Recorded Script. For example, after you select New Session, the script contains the following line:
// Created by New Session: opens a tab in an isolated browser session tab1 = Tabs.NewTab(Session.N1);
Once the recording is complete, you can edit the script in the Scrip Code editor. See the Create Independent Sessions in the Script Code section below.
Create Independent Sessions in the Script Code
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);
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;



