TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Selenium Grid

Selenium Grid Hub JSON Configuration

Overview

In this tutorial, we will learn how to customize Selenium Grid Hub with JSON Configuration file. We can customize Selenium Grid with JSON configuration file. JSON stands for JavaScript Object Notation. It is a light-weight data exchange format to exchange data between the client and the server. JSON is also human readable file format and used for configuration files.

Selenium Grid Hub Configuration

Create a JSON file with Hub configuration. We can specify and customize many configuration parameters in this file.

Sample Hub configuration file

We have changed the Grid listening port to 5555 and timeouts. Place the file in the Selenium jar directory. We can just pass the filename in the Grid start command in the next section.

{
 "port": 5555,
 "newSessionWaitTimeout": 12000,
 "servlets" : [],
 "withoutServlets": [],
 "custom": {},
 "capabilityMatcher": "org.openqa.grid.internal.utils.
DefaultCapabilityMatcher",
 "registry": "org.openqa.grid.internal.DefaultGridRegistry",
 "throwOnCapabilityNotPresent": true,
 "cleanUpCycle": 5000,
 "role": "hub",
 "debug": true,
 "browserTimeout": 120,
 "timeout": 120
}

Selenium Hub JSON File

Start the Hub with Config File

Now, we can start the Grid with the JSON configuration file using the below command. The command line switch is -hubConfig followed by the JSON configuration file name. The JSON file should define the hub properties.

\>java -jar <selenium-server-standalone-version.jar>  -role hub -hubConfig hubConfig.json

 

Selenium Grid Start Command with JSON config

Grid Console

Launch Grid Console to verify the configuration. In this example, we have used 5555 port

http://localhost:5555/grid/console

Click on the View Config link to check the Hub Configuration.

 

Selenium Grid Console View Config

In the next tutorial, we will see how to register a Node with configuration file:

Node Configuration JSON file

https://www.testingdocs.com/selenium-grid-node-json-configuration-file/

—

Selenium WebDriver Tutorials on this website can be found at:

https://www.testingdocs.com/selenium-webdriver-tutorial

For more details on the Selenium, visit the official website at:

https://www.selenium.dev/

Related Posts

Selenium Server Error

Selenium Grid /

Selenium Server Error: No drivers have been configured

Selenium4_Grid_Architecture

Selenium Grid /

Selenium 4 Grid Architecture

Selenium4_Grid_Components

Selenium Grid /

Selenium Grid 4.x Distributed Mode

Selenium 4 Standalone Grid

Selenium Grid /

Different Selenium Grid Modes in Selenium 4.0

Selenium grid foreground

Selenium Grid /

Run Selenium Grid in Background on Linux

› Selenium Grid Node JSON Configuration

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version