2
votes

I have added selenium-standalone.jar & selenium-java.jar but still I am getting the following exception when running the basic program,

Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver (wrong name: org/openqa/selenium/Webdriver) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:791) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2442) at java.lang.Class.getMethod0(Class.java:2685) at java.lang.Class.getMethod(Class.java:1620) at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:488) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:480)

Please provide the solution with proper steps to resolve this

2

2 Answers

1
votes

This is where a dependency manager (like Maven) can help you, versus manual copying of libs.

org.openqa.selenium.WebDriver can be found in selenium-api-<version>.jar

You will likely also need: selenium-remote-driver-<version>.jar and probably also selenium-support-<version>.jar, in addition to the selenium-java-<version>.jar you already have.

0
votes

I am expecting good to use only one either standalone or java specific jars. Please give try by using only selenium-server-standalone-2.xx.0.jar i hope its works fine.

If you are trying to use java specific jars please provide all jars in downloaded zip file instead only that selenium-java.jar file. If you add all jar files in downloaded zip i hope this issue will resolved.

Thank You, Murali