I am a beginner in Selenium web driver. I am getting some issues while calling driver.I am attaching the program and error for your reference. 1) I have already tried with standalone jar and individual jar files 2) Path also set correctly in environment variables.
I am using JDK 1.8 and eclipse neon for writing the code.
Please help me if you can..Tried so many ways which is mentioned on internet.Still couldn't identify what is the exact issue. This error started to throw on a particular day when I created a Testng sample program.
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class Sample22 {
public static void main(String[] args) { System.setProperty("webdriver.gecko.driver",//E://share//geckodriver.exe");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
//WebDriver driver1 = new MarionetteDriver(capabilities);
WebDriver driver1 = new FirefoxDriver();
}
}
Error is
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function at Sample22.main(Sample22.java:12) Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more