So far, we have seen test scripts that run on our local machines or on Selenium Standalone servers. Executing test scripts on Selenium Grid is very similar to executing tests on Remote WebDriver, except that you will also mention the platform details for Grid.
Let's look at a test script that uses the Remote WebDriver server:
public class SearchTest {
WebDriver driver;
@BeforeMethod
public void setup() throws MalformedURLException {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setBrowserName("chrome");
caps.setPlatform(Platform.MAC);
driver = new RemoteWebDriver(new URL("http://192.168.0.101:1111/wd/hub"), caps);
driver.get("http://demo-store.seleniumacademy.com/");
}
@Test
public void searchProduct() {
// find search...