Skip to content

Instantly share code, notes, and snippets.

@LenarBad
Created April 27, 2018 19:48
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 LenarBad/5451c1a027016d5ab5ee21a12cfd4512 to your computer and use it in GitHub Desktop.
Save LenarBad/5451c1a027016d5ab5ee21a12cfd4512 to your computer and use it in GitHub Desktop.
Selenium WebDriver - open a local html file. The file should be placed in the resources folder
String path = this.getClass().getResource("/my-local-form-page.html").getPath();
driver.get("file://" + path);
driver.findElement(By.id("button")).click();
@LenarBad
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment