java – chrome无法在Selenium Webdriver中运行.我使用的是selenium 3.0.1 chrome v-54.0

public class sikuli {

    public static void main(String[] args) throws Exception {
        //Screen screen=new Screen();
        //screen.click("//home//exeter//Pictures//googlechrome.png");
        System.setProperty("webdriver.chrome.driver","//home//exeter//Documents//chromedriver");
        WebDriver driver=new ChromeDriver();
        driver.get("https://mail.google.com");

Starting ChromeDriver 2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3) on port 11320
Only local connections are allowed.
Oct 19, 2016 10:07:22 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end
Oct 19, 2016 10:08:22 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Exception in thread “main” org.openqa.selenium.NoSuchSessionException: no such session
(Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 4.4.0-43-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 9 milliseconds
Build info: version: ‘unknown’, revision: ‘350cf60’, time: ‘2016-10-13 10:43:56 -0700’
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=unknown error: Chrome failed to start: exited abnormally

最佳答案
看起来你在Linux机器上运行,所以“chromedriver”(没有.exe)应该没问题.只需确保您拥有最新的chrome和最新的Chrome驱动程序版本,并且您还拥有正确的“chromedriver”文件(64位上的文件).

转载注明原文:java – chrome无法在Selenium Webdriver中运行.我使用的是selenium 3.0.1 chrome v-54.0 - 代码日志