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 Hub and Nodes

Introduction

In this post, we will discuss the hub and nodes configuration with Selenium grid ( Get Started with Selenium Grid). Also, we will see sample command line commands to start the hub and register nodes. Furthermore, I have used the Windows 10 operating system and Selenium server 2.53.1 version and localhost.

First of all, to set up Selenium grid we need Selenium Server. We can download the server jar file from selenium official website here:  http://www.seleniumhq.org/download/

Tip: Always download the latest version, the latest version would have bug fixes and enhancements.

 

Selenium Grid Standalone

Selenium Hub

To start the hub, open the command prompt and navigate to the location where you have a jar file. We can start it by using the following command.

/>  java -jar selenium-server-standalone-<<version>>.jar -role hub

After you have run the above command, it will start. Also, you should see a success message that it has started successfully. Also, it runs at a default port 4444. Furthermore, you can check the status in the browser by typing the URL:

http://localhost:4444/grid/console.

Selenium Nodes

Now, we will register a node. To do that,  open another new command prompt window and navigate to the location where you have jar file. Type the below command to register a node.

/> java -jar selenium-server-standalone-<<version>>.jar -role node -hub http://localhost:4444/grid/register

As a result, to check the node status, visit http://localhost:4444/grid/console in the browser.

NodeRegisteredCommandPrompt

 

In addition, we can also customize the browsers and the no of instances we need for testing. For example, If we want to launch 2 Firefox and 2 internet explorer instances for testing.

Below is the command to customize the instances.

/> java -jar selenium-server-standalone-2.53.1.jar -role node -hub http://localhost:4444/grid/register -port 5555 -browser browserName=firefox,maxInstances=2 -browser browserName=iexplorer,maxInstances=2

 

Selenium Grid Console

 

Since we have customized, we can notice in the above figure that 2 firefox browser instances and 2 internet explorer instances are registered with the node. Also, notice that we can choose the port number for the node. In addition, if we want to start browser instances at the port 5557 we can specify that in the above command.

Run a test

https://www.testingdocs.com/running-test-using-remotewebdriver-with-marionette/

—

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 2.0 Overview› Get Started with Selenium Grid

Recent Posts

  • Update draw.io on Windows
  • 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