• TestingDocs
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 2.0 Overview

Overview

Selenium Grid 2.0 allows us to run distributed tests on multiple machines that supports both the legacy Selenium RC and Webdriver.

Hub

Start the hub with default configuration. The Hub starts on the default port 4444.

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

 

Start Selenium Grid 2.0 Hub

However, the Hub support many command line switches to change the behavior. For example, to start the Hub on non default port 7777, we can use the following command:

\>java -jar selenium-server-standalone-2.53.0.jar -role hub -port 7777

Node

Register a node with default configuration.

\> java -jar selenium-server-standalone-<version>.jar -role node

To register to the Hub that’s running on port 7777, we can use the following command:

\>java -jar selenium-server-standalone-2.53.0.jar -role node -hubPort 7777

Selenium Grid 2.0 Console

We can view the status of the Selenium Hub by opening a browser window and navigating to the following URL:

http://localhost:4444/grid/console

 

Selenium Grid 2.0

We can use the same selenium-server-standalone jar file to run the tests with both WebDriver and Selenium 1 Remote Control at the same time.

Selenium RC Tests

For Selenium RC tests we can use:

For default Configuration:

Selenium selenium = new DefaultSelenium(“localhost”, 4444, “*firefox”, “http://Application_under_test_URL”);

For the above example:

Selenium selenium = new DefaultSelenium(“localhost”, 7777, “*firefox”, “http://applicationURL.com”);

Webdriver Tests

WebDriver Tests in Selenium 2.x/3.x, we need to use the RemoteWebDriver and the DesiredCapabilities

DesiredCapabilities caps = DesiredCapabilities.firefox();

For default Configuration:

WebDriver driver = new RemoteWebDriver(new URL(“http://localhost:4444/wd/hub”), caps);

For the above example:

WebDriver driver = new RemoteWebDriver(new URL(“http://localhost:7777/wd/hub”), caps);

—

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

Recent Posts

  • How to secure your SQL Database: Tips and Tricks
  • Shaping the Future of Development: Exploring Key Trends in Software Engineering
  • Improving Java Performance with Multithreading
  • Difference between PHP and JavaScript?
  • Bing Conversation Styles
  • ChatGPT Introduction
  • Open Source AI Frameworks
  • Artificial Intelligence Tools
  • Top AI Music Applications
  • Top AI Website Design Tools

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com