Why JsonElement error in one Eclipse package, but not another

All.. I’m using Eclipse Neon(4.6.3) for Java Developers, WebDriver Gecko for Firefox. I think I have all the right WebDriver plugins in my BuildPath:
selenium-java-3.14.0\client-combined-3.0.0-nodeps.jar
selenium-java-3.14.0\client-combined-3.14.0.jar
selenium-java-3.14.0\client-combined-3.14.0-sources.jar

Anyway, this call is successful for my firstTestCase, but fails in every other subsequent TestCase.

#START##########################################
package weblogic;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

//import org.openqa.selenium.By;
//import org.openqa.selenium.By.ByName;
//import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.WebElement;
//import org.openqa.selenium.firefox.FirefoxDriver;

public class Caller {

public static void main(String[] args) {
System.setProperty(“webdriver.gecko.driver”,”D:\\\\Downloads\\Selenium\\geckodriver-v0.23.0-win64\\geckodriver.exe”);

WebDriver driver = new FirefoxDriver();
driver.get(“http://<desktop>:7101/console/login/LoginForm.jsp“);

}

}
#END###########################################

The offending line is:
WebDriver driver = new FirefoxDriver();

Any ideas why it would fail in EVERY other Package/TestCase?

Console error is:
Exception in thread “main” java.lang.NoClassDefFoundError: com/google/gson/JsonElement
at org.openqa.selenium.firefox.FirefoxDriver.populateProfile(FirefoxDriver.java:209)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:238)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127)
at weblogic.Caller.main(Caller.java:17)
Caused by: java.lang.ClassNotFoundException: com.google.gson.JsonElement
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 4 more

New to Selenium and Eclipse.. Thanks for your help!!!

Default Asked on October 20, 2018 in Selenium WebDriver.
Add Comment
  • 1 Answer(s)

    I removed this .jar dependency and that resolved issue.

    selenium-java-3.14.0\client-combined-3.0.0-nodeps.jar

    Default Answered on November 1, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.