CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-seleniumhq-selenium--selenium-server

Selenium Grid server that enables distributed test execution across multiple browsers and operating systems.

Pending
Overview
Eval results
Files

configuration.mddocs/

Configuration Management

The Selenium Grid server provides a flexible configuration system supporting multiple sources with well-defined precedence rules for enterprise deployment scenarios.

Capabilities

Configuration Interface

Core interface for accessing configuration values throughout the Grid server.

package org.openqa.selenium.grid.config;

import java.util.Optional;

interface Config {
    /**
     * Get configuration value as Optional string
     * @param section Configuration section name
     * @param option Configuration option name
     * @return Optional containing value if present
     */
    Optional<String> get(String section, String option);
    
    /**
     * Get configuration value as Optional integer
     * @param section Configuration section name
     * @param option Configuration option name
     * @return Optional containing integer value if present and parseable
     */
    default Optional<Integer> getInt(String section, String option) {
        return get(section, option).map(Integer::parseInt);
    }
    
    /**
     * Get configuration value as Optional boolean
     * @param section Configuration section name
     * @param option Configuration option name
     * @return Optional containing boolean value if present and parseable
     */
    default Optional<Boolean> getBool(String section, String option) {
        return get(section, option).map(Boolean::parseBoolean);
    }
}

Configuration Sources

Configuration sources are applied in order of precedence (highest to lowest):

// Precedence order (1 = highest priority)
1. AnnotatedConfig     // From @ConfigValue annotations on flag classes
2. EnvConfig          // Environment variables (section.option format)
3. ConcatenatingConfig // System properties (selenium.section.option format)
4. CompoundConfig     // Combines multiple configuration sources

Environment Variables

Set configuration using environment variables with section.option format:

# Environment variable format
export section.option=value

# Examples
export server.port=4444
export server.hostname=grid-hub.example.com
export node.detect-drivers=true
export distributor.port=5553

System Properties

Set configuration using Java system properties with selenium prefix:

# System property format
-Dselenium.section.option=value

# Examples
java -Dselenium.server.port=4444 -jar selenium-server.jar standalone
java -Dselenium.node.detect-drivers=true -jar selenium-server.jar node

Configuration Sections

Server Section

Basic server configuration options available for all components.

// server section options
server.hostname         // Server hostname or IP address
server.port            // Port number to listen on
server.max-threads     // Maximum number of Jetty threads

Examples:

# Environment variables
export server.hostname=0.0.0.0
export server.port=4444
export server.max-threads=200

# System properties
-Dselenium.server.hostname=grid-hub.local
-Dselenium.server.port=4445

Distributor Section

Configuration specific to the distributor component.

// distributor section options
distributor.host        // Distributor URI or hostname
distributor.port       // Distributor port number
distributor.hostname   // Distributor hostname

Examples:

# Environment variables
export distributor.host=http://distributor-service:5553
export distributor.port=5553
export distributor.hostname=distributor.grid.local

# System properties
-Dselenium.distributor.host=http://localhost:5553
-Dselenium.distributor.port=5553

Sessions Section

Configuration for the session map component.

// sessions section options
sessions.host          // Session map URI or hostname
sessions.port         // Session map port number
sessions.hostname     // Session map hostname

Examples:

# Environment variables
export sessions.host=http://sessions-service:5556
export sessions.port=5556
export sessions.hostname=sessions.grid.local

# System properties
-Dselenium.sessions.host=http://localhost:5556
-Dselenium.sessions.port=5556

Node Section

Configuration specific to node components.

// node section options
node.detect-drivers    // Boolean flag to auto-detect available drivers

Examples:

# Environment variables
export node.detect-drivers=true

# System properties
-Dselenium.node.detect-drivers=true

Configuration Options Classes

The configuration system uses specific option classes for type-safe configuration access.

BaseServerOptions

Base server configuration options used by all server components.

class BaseServerOptions {
    // Server hostname (defaults to auto-detected)
    String getHostname();
    
    // Server port number
    int getPort();
    
    // Maximum Jetty threads
    int getMaxThreads();
}

SessionMapOptions

Configuration options specific to session map components.

class SessionMapOptions {
    // Session map service URI
    URI getSessionMap();
    
    // Session map hostname
    String getSessionMapHost();
    
    // Session map port
    int getSessionMapPort();
}

DistributorOptions

Configuration options for distributor components.

class DistributorOptions {
    // Distributor service URI
    URI getDistributor();
    
    // Distributor hostname
    String getDistributorHost();
    
    // Distributor port
    int getDistributorPort();
}

Configuration Examples

Standalone Server Configuration

# Using environment variables
export server.port=4440
export server.hostname=192.168.1.100
export node.detect-drivers=true

java -jar selenium-server.jar standalone
# Using system properties
java -Dselenium.server.port=4440 \
     -Dselenium.server.hostname=192.168.1.100 \
     -Dselenium.node.detect-drivers=true \
     -jar selenium-server.jar standalone

Distributed Setup Configuration

Hub configuration:

# Hub server
export server.port=4444
export server.hostname=hub.grid.local

java -jar selenium-server.jar hub

Node configuration:

# Node server
export server.port=5555
export distributor.host=http://hub.grid.local:4444
export sessions.host=http://hub.grid.local:4444
export node.detect-drivers=true

java -jar selenium-server.jar node

Microservices Configuration

Router service:

export server.port=4444
java -jar selenium-server.jar router

Distributor service:

export server.port=5553
java -jar selenium-server.jar distributor

Session map service:

export server.port=5556
java -jar selenium-server.jar sessions

Node service:

export server.port=5555
export distributor.host=http://distributor-host:5553
export sessions.host=http://sessions-host:5556
java -jar selenium-server.jar node

Default Values

When no configuration is provided, the system uses these defaults:

// Default configuration values
server.hostname = "0.0.0.0"      // Listen on all interfaces
server.port = 4444               // Standard Selenium port (hub/router/standalone)
server.port = 5555               // Standard node port
server.port = 5553               // Standard distributor port  
server.port = 5556               // Standard session map port
node.detect-drivers = false      // Manual driver configuration

Configuration Validation

The configuration system validates values at startup and provides clear error messages for invalid configurations:

// Common validation errors
"Invalid port number: must be between 1 and 65535"
"Invalid hostname format"
"Cannot connect to distributor at specified URI"
"Required configuration option not provided: distributor.host"

Install with Tessl CLI

npx tessl i tessl/maven-org-seleniumhq-selenium--selenium-server

docs

cli.md

configuration.md

extensions.md

index.md

rest-api.md

tile.json