简体   繁体   中英

chrome is not able to run in Selenium Webdriver . i am using 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

It looks like you are running on a Linux machine, so "chromedriver" (without .exe) should be fine. Just make sure you have the latest chrome and latest chrome driver versions, and also you have the correct "chromedriver" file (the one on 64 bits).

Please check path is correct for chrome driver version https://chromedriver.chromium.org . you need use chrome driver according to which chrome browser version are using

If you are running on windows you need to specify .exe at the end too(Unless you are running on Linux) On a side note try this https://github.com/bonigarcia/webdrivermanager . It will automatically download the driver for you based on your browser and OS. Managing the driver manually is just a waste of time in my opinion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM