public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:/Users/myPC/Desktop/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
}
所以我下载了chromedriver.exe并尝试使用以下代码打开Chrome,但每次运行此代码时都会出现以下错误:
Error:java: package com.google.common.collect does not exist
每当我尝试从桌面运行chromedriver.exe时,chrome都不想打开。
提前致谢
答案 0 :(得分:-2)
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:/Users/myPC/Desktop/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.navigate().to("http://www.google.com");
}