Quaatso Education

Home Forums Selenium Forum Webdriver exception unable to run a script for a website

Webdriver exception unable to run a script for a website

This topic contains 1 reply, has 2 voices, and was last updated by  Nandan Singh 1 year, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #4382

    Rahul Mehta

    Exception in thread “main” java.lang.NoClassDefFoundError: org/testng/TestNGException

    at java.lang.Class.getDeclaredMethods0(Native Method)

    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)

    at java.lang.Class.privateGetMethodRecursive(Unknown Source)

    at java.lang.Class.getMethod0(Unknown Source)

    at java.lang.Class.getMethod(Unknown Source)

    at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)

    at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

    Caused by: java.lang.ClassNotFoundException: org.testng.TestNGException

    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)

    … 7 more



    Nandan Singh

    Rahul, the problem is with your TestNG library. Please follow given steps to resolve this :

    1. Create another workspace in eclipse

    2. Create a new project.

    3. Add TestNG library in build path.

    4. Again create a test class and add only one @Test annotation.

    5. Now Run the code and it should be working fine.

    If it still creating problem, please let me know.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.