# seleniumhq/selenium architecture

> Architecture diagram of the GitHub repository seleniumhq/selenium, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/seleniumhq/selenium
- Repository: https://github.com/seleniumhq/selenium
- Video tour (about a minute): https://gitdiagram.com/seleniumhq/selenium/video

## Overview

Selenium is a cross-browser automation project implementing the W3C WebDriver interface, with language bindings and browser-specific driver services. A typical flow configures a driver service, resolves and launches its driver server, then sends browser-automation commands; the tree also shows WebDriver BiDi storage and JavaScript features, an Internet Explorer driver, and a Grid UI. The sampled files establish some internal delegation and service behavior, but not a complete end-to-end binding-to-browser request path, so those links are omitted.

Main entry points: [`java/src/org/openqa/selenium/remote/service/DriverService.java`](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/remote/service/DriverService.java) (Driver service), [`java/src/org/openqa/selenium/chrome/ChromeDriverService.java`](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/chrome/ChromeDriverService.java) (Chrome service), [`java/src/org/openqa/selenium/edge/EdgeDriverService.java`](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/edge/EdgeDriverService.java) (Edge service), [`java/src/org/openqa/selenium/firefox/GeckoDriverService.java`](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/firefox/GeckoDriverService.java) (Firefox service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_services["Driver services"]
  node_chrome["Chrome service"]
  node_edge["Edge service"]
  node_firefox["Firefox service"]
  node_safari["Safari TP service"]
  node_service["Driver service<br/>[DriverService.java]"]
  node_finder["Driver discovery<br/>[DriverFinder.java]"]
end

subgraph group_iedriver["IE automation"]
  node_iehttp["WebDriver HTTP server<br/>[server.cc]"]
  node_ieexecutor["IE command executor"]
  node_iehandlers["IE command handlers"]
  node_ieinput["IE input manager<br/>[InputManager.cpp]"]
  node_iesim["IE action simulators"]
end

subgraph group_bidi["BiDi features"]
  node_dotnetbidi["BiDi connection<br/>[BiDi.cs]"]
  node_dotnetstorage["BiDi storage<br/>[StorageModule.cs]"]
  node_contextstorage["Context storage"]
  node_jsstorage["JavaScript BiDi storage<br/>[storage.js]"]
  node_jsengine["JavaScript engine"]
end

subgraph group_web["Grid interface"]
  node_gridui["Grid dashboard<br/>[App.tsx]"]
end

node_user(("Automation client"))
node_driverprocess["Driver server process"]
node_browserdevtools["Browser DevTools"]

node_user -.->|"configures browser"| node_chrome
node_user -.->|"configures browser"| node_edge
node_user -.->|"configures browser"| node_firefox
node_user -.->|"configures browser"| node_safari
node_chrome -.->|"extends"| node_service
node_edge -.->|"extends"| node_service
node_firefox -.->|"extends"| node_service
node_safari -.->|"extends"| node_service
node_service -->|"uses discovery"| node_finder
node_service -->|"launches process"| node_driverprocess
node_iehttp -.->|"dispatches commands"| node_ieexecutor
node_ieexecutor -.->|"routes commands"| node_iehandlers
node_ieinput -->|"selects simulator"| node_iesim
node_dotnetbidi -->|"exposes module"| node_dotnetstorage
node_contextstorage -->|"delegates storage"| node_dotnetstorage
node_jsstorage -.->|"accepts cookie requests"| node_user
node_jsengine -->|"uses DevTools session"| node_browserdevtools
node_gridui -.->|"presents Grid views"| node_user

click node_chrome "https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/chrome/ChromeDriverService.java"
click node_edge "https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/edge/EdgeDriverService.java"
click node_firefox "https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/firefox/GeckoDriverService.java"
click node_safari "https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/safari/SafariTechPreviewDriverService.java"
click node_service "https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/remote/service/DriverService.java"
click node_finder "https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/remote/service/DriverFinder.java"
click node_iehttp "https://github.com/seleniumhq/selenium/blob/trunk/cpp/webdriver-server/server.cc"
click node_ieexecutor "https://github.com/seleniumhq/selenium/blob/trunk/cpp/iedriver/IECommandExecutor.cpp"
click node_iehandlers "https://github.com/seleniumhq/selenium/tree/trunk/cpp/iedriver/CommandHandlers"
click node_ieinput "https://github.com/seleniumhq/selenium/blob/trunk/cpp/iedriver/InputManager.cpp"
click node_iesim "https://github.com/seleniumhq/selenium/tree/trunk/cpp/iedriver/ActionSimulators"
click node_dotnetbidi "https://github.com/seleniumhq/selenium/blob/trunk/dotnet/src/webdriver/BiDi/BiDi.cs"
click node_dotnetstorage "https://github.com/seleniumhq/selenium/blob/trunk/dotnet/src/webdriver/BiDi/Storage/StorageModule.cs"
click node_contextstorage "https://github.com/seleniumhq/selenium/blob/trunk/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextStorageModule.cs"
click node_jsstorage "https://github.com/seleniumhq/selenium/blob/trunk/javascript/selenium-webdriver/bidi/storage.js"
click node_jsengine "https://github.com/seleniumhq/selenium/blob/trunk/dotnet/src/webdriver/JavaScriptEngine.cs"
click node_gridui "https://github.com/seleniumhq/selenium/blob/trunk/javascript/grid-ui/src/App.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chrome,node_edge,node_firefox,node_safari,node_service,node_finder,node_user,node_browserdevtools toneBlue
class node_iehttp,node_ieexecutor,node_iehandlers,node_ieinput,node_iesim toneAmber
class node_dotnetbidi,node_dotnetstorage,node_contextstorage,node_jsstorage,node_jsengine,node_driverprocess toneMint
class node_gridui toneRose
```

## Components

### Driver services

- [Chrome service](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/chrome/ChromeDriverService.java): `java/src/org/openqa/selenium/chrome/ChromeDriverService.java`
- [Edge service](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/edge/EdgeDriverService.java): `java/src/org/openqa/selenium/edge/EdgeDriverService.java`
- [Firefox service](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/firefox/GeckoDriverService.java): `java/src/org/openqa/selenium/firefox/GeckoDriverService.java`
- [Safari TP service](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/safari/SafariTechPreviewDriverService.java): `java/src/org/openqa/selenium/safari/SafariTechPreviewDriverService.java`
- [Driver service](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/remote/service/DriverService.java): `java/src/org/openqa/selenium/remote/service/DriverService.java`
- [Driver discovery](https://github.com/seleniumhq/selenium/blob/trunk/java/src/org/openqa/selenium/remote/service/DriverFinder.java): `java/src/org/openqa/selenium/remote/service/DriverFinder.java`

### IE automation

- [WebDriver HTTP server](https://github.com/seleniumhq/selenium/blob/trunk/cpp/webdriver-server/server.cc): `cpp/webdriver-server/server.cc`
- [IE command executor](https://github.com/seleniumhq/selenium/blob/trunk/cpp/iedriver/IECommandExecutor.cpp): `cpp/iedriver/IECommandExecutor.cpp`
- [IE command handlers](https://github.com/seleniumhq/selenium/tree/trunk/cpp/iedriver/CommandHandlers): `cpp/iedriver/CommandHandlers`
- [IE input manager](https://github.com/seleniumhq/selenium/blob/trunk/cpp/iedriver/InputManager.cpp): `cpp/iedriver/InputManager.cpp`
- [IE action simulators](https://github.com/seleniumhq/selenium/tree/trunk/cpp/iedriver/ActionSimulators): `cpp/iedriver/ActionSimulators`

### BiDi features

- [BiDi connection](https://github.com/seleniumhq/selenium/blob/trunk/dotnet/src/webdriver/BiDi/BiDi.cs): `dotnet/src/webdriver/BiDi/BiDi.cs`
- [BiDi storage](https://github.com/seleniumhq/selenium/blob/trunk/dotnet/src/webdriver/BiDi/Storage/StorageModule.cs): `dotnet/src/webdriver/BiDi/Storage/StorageModule.cs`
- [Context storage](https://github.com/seleniumhq/selenium/blob/trunk/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextStorageModule.cs): `dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextStorageModule.cs`
- [JavaScript BiDi storage](https://github.com/seleniumhq/selenium/blob/trunk/javascript/selenium-webdriver/bidi/storage.js): `javascript/selenium-webdriver/bidi/storage.js`
- [JavaScript engine](https://github.com/seleniumhq/selenium/blob/trunk/dotnet/src/webdriver/JavaScriptEngine.cs): `dotnet/src/webdriver/JavaScriptEngine.cs`

### Grid interface

- [Grid dashboard](https://github.com/seleniumhq/selenium/blob/trunk/javascript/grid-ui/src/App.tsx): `javascript/grid-ui/src/App.tsx`

### Other components

- **Automation client**
- **Driver server process**
- **Browser DevTools**

## Connections

- Automation client → Chrome service: configures browser
- Automation client → Edge service: configures browser
- Automation client → Firefox service: configures browser
- Automation client → Safari TP service: configures browser
- Chrome service → Driver service: extends (evidence: `java/src/org/openqa/selenium/chrome/ChromeDriverService.java`)
- Edge service → Driver service: extends (evidence: `java/src/org/openqa/selenium/edge/EdgeDriverService.java`)
- Firefox service → Driver service: extends (evidence: `java/src/org/openqa/selenium/firefox/GeckoDriverService.java`)
- Safari TP service → Driver service: extends (evidence: `java/src/org/openqa/selenium/safari/SafariTechPreviewDriverService.java`)
- Driver service → Driver discovery: uses discovery (evidence: `java/src/org/openqa/selenium/remote/service/DriverService.java`)
- Driver service → Driver server process: launches process (evidence: `java/src/org/openqa/selenium/remote/service/DriverService.java`)
- WebDriver HTTP server → IE command executor: dispatches commands
- IE command executor → IE command handlers: routes commands
- IE input manager → IE action simulators: selects simulator (evidence: `cpp/iedriver/InputManager.cpp`)
- BiDi connection → BiDi storage: exposes module (evidence: `dotnet/src/webdriver/BiDi/BiDi.cs`)
- Context storage → BiDi storage: delegates storage (evidence: `dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextStorageModule.cs`)
- JavaScript BiDi storage → Automation client: accepts cookie requests
- JavaScript engine → Browser DevTools: uses DevTools session (evidence: `dotnet/src/webdriver/JavaScriptEngine.cs`)
- Grid dashboard → Automation client: presents Grid views
