Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
3.4k views
in Programming by
recategorized by
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 {      
    @Test
    public void action()    {
        System.out.println("Test");     
    }
}
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

0 like 0 dislike
by
selected by
 
Best answer
Kindly update your classpath with adding JDK.

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


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...