41. Distributed Execution with Selenium Grid 4 & RemoteWebDriver

Selenium Grid 4 Architecture

- Hub / Router: Central point that receives test requests from client machines and routes them to nodes. - Node: Machines where browsers actually launch and run tests. - RemoteWebDriver: WebDriver implementation that executes commands across network HTTP calls:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import java.net.URL;

URL gridUrl = new URL("http://grid-hub.targetqa.internal:4444");
ChromeOptions options = new ChromeOptions();

WebDriver driver = new RemoteWebDriver(gridUrl, options);
driver.get("https://targetqa.com");

Task

  • Implement formatGridUrl:
  • 1. Accept String host and int port.
  • 2. Return "http://" + host + ":" + port + "/wd/hub".
πŸ’‘Common doubts
Did you like the problem?
Lesson 41 of 44
Java
Loading code editor…
Next