Exception while running eclipse in TestNG frame work - java.lang.NoClassDefFoundError

Solved 1 Answers 1396 Views Programming
0 1
I has to run Selenium in TestNG Frame work : Steps I had followed are,

1) Added TestNG to my Eclipse, From Help : New installation > http://beust.com/eclipse. (As my version of eclipse is :4.3.2)

2) Let's take some sample program as :

package TestNG;

import org.testng.annotations.Test;

public class Annotations {      
    public void action()    {
3) added TestNG libraries.

4) And now while executing this, am facing an exception as follows:

Couldn't contact the RemoteTestNG Client. Make sure you don't have an
older version of testing.jar in your class path

Reason:Timeout wile trying to contact remote TestNG.
and in Console :

Exception in thread "main" java.lang.NoClassDefFoundError:
com/beust/jcommander/ParameterException     at
java.lang.Class.getDeclaredMethods0(Native Method)  at
java.lang.Class.privateGetDeclaredMethods(Unknown Source)   at
java.lang.Class.getMethod0(Unknown Source)  at
java.lang.Class.getMethod(Unknown Source)   at
sun.launcher.LauncherHelper.getMainMethod(Unknown Source)   at
sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused
by: java.lang.ClassNotFoundException:
com.beust.jcommander.ParameterException     at
java.net.URLClassLoader$1.run(Unknown Source)   at
java.net.URLClassLoader$1.run(Unknown Source)   at
java.security.AccessController.doPrivileged(Native Method)  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)     ... 6 more
Can anyone have a look on this n provide me some tips to solve this

1 Answer

Best answer
Kindly update your classpath with adding JDK.

Also try to update your classpath with proper version of TestNG libraries.
answered by
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

We have resolved 1.2k+ Software Testing queries!

Top Contributors