public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","C:\\Users\\Administrator\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.baidu.com");
driver.quit();
}
}
运行这段代码之后,出现如下的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function
at testWeb.testDriver.main(testDriver.java:10)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
实在是没有找到合适的办法,麻烦大家给点意见