Search code examples
eclipseseleniumtestingselenium-webdriverfirefox-marionette

How to solve "java.lang.NoClassDefFoundError: org/json/JSONException"


I am using marionette driver for testing with selenium. when I run the code it gives me the error:

java.lang.NoClassDefFoundError: org/json/JSONException.

Also gives error :

Found argument '--webdriver-port' which wasn't expected, or isn't valid in this context

Please help for the same

I have used "java-json.jar" however now it's give the error "org.openqa.selenium.WebDriverException: java.net.ConnectException: Connection refused:" so can you suggest what issue is for the same


Solution

  • Try adding java-json/.jar in your classpath. Download the jar from Jar link