无法在日食中打开chromedriver

时间:2017-12-16 15:04:24

标签: eclipse selenium webdriver

enter image description here

我在尝试执行简单代码以启动Chrome浏览器并打开google.com但无法启动浏览器时遇到错误。附件是错误信息。

这是代码 -

package gmailpkg;

import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;

public class login {

    public static String driverPath = "X:/JARs-Setup/chromedriver_win32/";
    public static WebDriver driver;

    public static void main(String []args) throws InterruptedException {
        System.out.println("launching chrome browser");
        System.setProperty("webdriver.chrome.driver", driverPath+"chromedriver.exe");
        driver = new ChromeDriver();
        driver.get("http://google.com");
        Thread.sleep(2000);

        //driver.manage().window().maximize();
        Thread.sleep(2000);
        driver.findElement(By.xpath( "//*[@href='https://mail.google.com/mail/?tab=wm']")).click();

    }
}

0 个答案:

没有答案