Skip to content

Instantly share code, notes, and snippets.

@diemol
Created June 16, 2020 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diemol/a948c6dee6f884446f5bc7d045ff3ebf to your computer and use it in GitHub Desktop.
Save diemol/a948c6dee6f884446f5bc7d045ff3ebf to your computer and use it in GitHub Desktop.
SimpleChromeTest
public void simpleChromeTest() throws MalformedURLException {
URL gridUrl = new URL("http://localhost:4444/wd/hub");
RemoteWebDriver webDriver = new RemoteWebDriver(gridUrl, new ChromeOptions());
webDriver.get("http://www.google.com/ncr");
webDriver.findElement(By.name("q")).sendKeys("webdriver", Keys.RETURN);
WebDriverWait webDriverWait = new WebDriverWait(webDriver, Duration.ofSeconds(5));
webDriverWait.until(ExpectedConditions.titleContains("webdriver"));
webDriver.quit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment