---
title: Get Selenium SessionID with WebDriver
description: Documentation on how to retrieve the Selenium WebDriver SessionID during
  your tests
source_url:
  html: https://testingbot.com/support/web-automate/selenium/get-session-id
  md: https://testingbot.com/support/web-automate/selenium/get-session-id.md
---

# 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](https://www.w3.org/TR/webdriver/#dfn-generating-a-uuid).

You can use this unique identifier for your own purposes, or to use it in combination with the [TestingBot API](https://testingbot.com/support/api).

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

[Java](https://testingbot.com#) [Python](https://testingbot.com#) [NodeJS](https://testingbot.com#) [Ruby](https://testingbot.com#) [PHP](https://testingbot.com#) [C#](https://testingbot.com#)

```java
RemoteWebDriver driver = new RemoteWebDriver(new URL(URL), options);
String sessionId = driver.getSessionId().toString();
```

```python
session_id = driver.session_id
```

```javascript
const session = await driver.getSession();
const sessionId = session.getId();
```

```ruby
session_id = driver.session_id
```

```php
$sessionId = $driver->getSessionID();
```

```csharp
string sessionId = ((RemoteWebDriver)driver).SessionId.ToString();
```

## Using the Selenium SessionID

You can use the Selenium SessionID to [mark a test as passed or failed](https://testingbot.com/support/web-automate/selenium/status).

You can also use the WebDriver sessionID to link to a test or [share a test](https://testingbot.com/support/other/sharing).

### Looking for more help?

Have questions or need more information? Reach out via email or Slack.

[Email us](https://testingbot.com/contact/new) [Join our Slack](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
