selenium webdriver grid code example
Example 1: selenium grid
Selenium Grid can be used to execute
same or different test scripts on
multiple platforms and browsers
concurrently so as to achieve distributed test execution.
It allows running test cases in parallel
thereby saving test execution time.
It allows multi-browser testing.
It allows multi-OS testing.
It allows multi-platform testing (desktop, mobile).
Example 2: how to configure selenium grid to driver
I configure my driver class to run remote test.
DesiredCapabilities.desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browser","chrome");
URL gridUrl = new URL("http://ipAdress.4444/wd/hub");
driverPool.set(new RemoteWebDriver(gridUrl, desiredCapabilities));