启动firefox浏览器报错,不知道问题出在哪里,求解救
package com.selenium.study; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; public class study3 { public static void main(String[] args) { //实例化一个对象Firefox WebDriver driver; System.setProperty("webdriver.firefox.bin","C:\\Program Files\\Mozilla Firefox\\firefox.exe"); driver = new FirefoxDriver(); String testurl="http://www.baidu.com"; driver.get(testurl); driver.quit(); } }
报错:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function
at com.selenium.study.study3.main(study3.java:9)
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