Skip to main content

Get Selenium WebDriver SessionID

The Selenium WebDriver SessionID is a unique identifier for each of your tests. Usually it's returned in a UUID format.

You can use this unique identifier for your own purposes, or to use it in combination with the TestingBot API.

Please see the examples below on how to retrieve the SessionID:

RemoteWebDriver driver = new RemoteWebDriver(new URL(URL), options);
String sessionId = driver.getSessionId().toString();
session_id = driver.session_id
const session = await driver.getSession();
const sessionId = session.getId();
session_id = driver.session_id
$sessionId = $driver->getSessionID();
string sessionId = ((RemoteWebDriver)driver).SessionId.ToString();

Using the Selenium SessionID

You can use the Selenium SessionID to mark a test as passed or failed.

You can also use the WebDriver sessionID to link to a test or share a test.

Was this page helpful?

Looking for More Help?

Have questions or need more information?
You can reach us via the following channels: