or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

cli.mdconfiguration.mdextensions.mdindex.mdrest-api.md

index.mddocs/

0

# Selenium Grid Server

1

2

Selenium Grid server enables distributed WebDriver test execution across multiple browsers and operating systems. It consists of a hub-and-node architecture where the hub acts as a central registry and router for WebDriver commands, while nodes provide actual browser instances. The server supports multiple browser types and can distribute test execution based on desired capabilities.

3

4

## Package Information

5

6

- **Package Name**: org.seleniumhq.selenium:selenium-server

7

- **Package Type**: maven

8

- **Language**: Java

9

- **Version**: 3.141.59

10

- **Installation**: `<dependency><groupId>org.seleniumhq.selenium</groupId><artifactId>selenium-server</artifactId><version>3.141.59</version></dependency>` or standalone JAR download

11

12

## Core Imports

13

14

Primary entry points for Selenium Grid server:

15

16

```java

17

// Main Grid launcher (recommended for v3.141.59)

18

org.openqa.grid.selenium.GridLauncherV3

19

20

// Modern Grid interface (limited support in v3.141.59)

21

org.openqa.selenium.grid.Main

22

23

// Standalone server entry point

24

org.openqa.selenium.remote.server.SeleniumServer

25

```

26

27

## Basic Usage

28

29

Start the server using Java with the standalone JAR:

30

31

```bash

32

java -jar selenium-server-standalone-3.141.59.jar <command> [options]

33

```

34

35

Traditional Grid 3 syntax (recommended for v3.141.59):

36

37

```bash

38

# Start complete Grid in single process

39

java -jar selenium-server-standalone-3.141.59.jar -role standalone -port 4444

40

41

# Start distributed setup

42

java -jar selenium-server-standalone-3.141.59.jar -role hub -port 4444

43

java -jar selenium-server-standalone-3.141.59.jar -role node -hub http://hub-host:4444

44

```

45

46

Modern command syntax (limited support in v3.141.59):

47

48

```bash

49

java -jar selenium-server-standalone-3.141.59.jar standalone --port 4444

50

java -jar selenium-server-standalone-3.141.59.jar hub --port 4444

51

java -jar selenium-server-standalone-3.141.59.jar node --distributor http://hub-host:4444

52

```

53

54

## Architecture

55

56

The Selenium Grid server is built around several key architectural components:

57

58

- **CLI Commands**: Traditional Grid 3 role-based commands plus limited modern command support

59

- **HTTP REST API**: WebDriver protocol endpoints plus Grid-specific management APIs

60

- **Configuration System**: Multi-layered configuration with CLI args, environment variables, and system properties

61

- **Service Discovery**: ServiceLoader-based command registration and auto-discovery

62

- **Session Management**: Distributed session tracking across multiple nodes

63

- **Request Routing**: Intelligent routing based on browser capabilities

64

65

## Capabilities

66

67

### Command Line Interface

68

69

CLI interface providing traditional Grid 3 role-based commands and limited modern command support for different deployment scenarios.

70

71

```bash { .api }

72

# Traditional Grid 3 syntax (recommended)

73

java -jar selenium-server-standalone-3.141.59.jar -role <hub|node|standalone> [options]

74

75

# Modern command syntax (limited support)

76

java -jar selenium-server-standalone-3.141.59.jar <command> [options]

77

# Commands: standalone, hub, node, router, distributor, sessions

78

```

79

80

[Command Line Interface](./cli.md)

81

82

### HTTP REST API

83

84

REST API endpoints for WebDriver protocol implementation, session management, node registration, and Grid administration.

85

86

```java { .api }

87

// Core endpoint patterns

88

POST /session // Create new WebDriver session

89

GET /session/{sessionId}/* // WebDriver commands

90

POST /se/grid/session/{sessionId} // Register session with Grid

91

GET /status // Get component status

92

POST /se/grid/distributor/node // Register node with distributor

93

```

94

95

[HTTP REST API](./rest-api.md)

96

97

### Configuration Management

98

99

Flexible configuration system supporting multiple sources with well-defined precedence rules for enterprise deployment scenarios.

100

101

```java { .api }

102

// Configuration interface

103

interface Config {

104

String get(String section, String option);

105

int getInt(String section, String option);

106

boolean getBool(String section, String option);

107

}

108

109

// Configuration sections: server, distributor, sessions, node

110

```

111

112

[Configuration Management](./configuration.md)

113

114

### Extension Points

115

116

Public interfaces and abstract classes for customizing Grid behavior, including session factories, command handlers, and component implementations.

117

118

```java { .api }

119

// Core extension interfaces

120

interface CommandHandler {

121

void execute(HttpRequest req, HttpResponse resp) throws IOException;

122

}

123

124

interface SessionFactory {

125

boolean isSupporting(Capabilities capabilities);

126

Optional<ActiveSession> apply(Set<Dialect> downstreamDialects, Capabilities capabilities);

127

}

128

```

129

130

[Extension Points](./extensions.md)