Skip to content

Instantly share code, notes, and snippets.

@creswick
Created January 10, 2012 06:47
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 creswick/1587495 to your computer and use it in GitHub Desktop.
Save creswick/1587495 to your computer and use it in GitHub Desktop.
ChromeDriver causes stack overflow if you specify the path to chrome via ChromeOptions
import java.io.File;
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class WebTest {
public static void main(String[] args) throws IOException {
// relative path to chrome driver binary:
String chromeDriverPth = "./src/main/resources/seleniumDrivers/linux64/chromedriver";
System.setProperty("webdriver.chrome.driver", chromeDriverPth);
// set chrome options with path to google-chrome binary:
ChromeOptions options = new ChromeOptions();
options.setBinary(new File("/usr/bin/google-chrome"));
// create the chrome driver:
WebDriver driver = new ChromeDriver(options);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment