TestNG is good framework inspired by JUnit, It is having advanced features than JUnit. I tried to install TestNG eclipse plugin to my Eclipse version of Juno. But I got some hell errors. Finally I was failed to install that in online. Then I tried to install that in offline. Initially I did some research on how to install TestNG plugin in offline and I found different jars for different versions of eclipse and some online forum users stated that they still getting some configuration issues. Then I decided to build suitable version of TestNG plugin with my own Eclipse. Follow the below procedure for successful installation

Download TestNG Eclipse Plugin Project

Download TestNG from the Github ( https://github.com/cbeust/testng-eclipse ). Once you download the ZIP file, extract it. Now you can see testing-eclipse-plugin folder in it. This is the Eclipse plugin project that we have to build.

Import Eclipse Plugin Project

Open your Eclipse
Click on "File > Import"
Now select "General > Existing Projects into Workspace"
Now click on "Next"
Now click on "Browse"
Now select the folder "testing-eclipse-plugin"
Now click on "ok"
Project will be created
Now right click on the project and click on "export"
Now select "Plug-in Development > Deployable plug-ins and fragments"
Click on "Next"
Now click on "Browse" and select the target folder
Click on "Finish"
Jar will be generated as like shown in the below image
This is the plugin jar which we required
Now copy this jar and paste in "dropins" folder of eclipse
Now restart the eclipse, Now you can see all TestNG options in active mode

11 comments:

  1. Hi Srinivas,
    I installed successfully but I am getting following error while running testng test in eclipse(no issues while running from mvn test). Can you please suggest how could i solve this issue.

    java.lang.UnsatisfiedLinkError: Failed to create temporary file for /com/sun/jna/win32-x86-64/jnidispatch.dll library: Access is denied
    at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:776)
    at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:736)
    at com.sun.jna.Native.(Native.java:131)
    at org.openqa.selenium.os.Kernel32.(Kernel32.java:34)
    at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:133)
    at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(UnixProcess.java:247)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$200(UnixProcess.java:201)
    at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:125)
    at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
    at org.openqa.selenium.remote.service.DriverService.stop(DriverService.java:196)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:94)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:620)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:670)
    at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:516)
    at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:132)
    at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
    at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:170)
    at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:159)
    at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:116)
    at sample.maven.proj.suiteA.TestA1.testA1(TestA1.java:13)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
    at org.testng.TestRunner.privateRun(TestRunner.java:782)
    at org.testng.TestRunner.run(TestRunner.java:632)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
    at org.testng.SuiteRunner.run(SuiteRunner.java:268)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1246)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1171)
    at org.testng.TestNG.run(TestNG.java:1066)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:113)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:206)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:177)

    ReplyDelete
    Replies
    1. Looks like it is having problem with /com/sun/jna folder read, write permissions. Update /com/sun/jna folder R/W permissions

      Delete
  2. I am facing the same issue , can any one please explain???

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Awesome!!
    I was trying to install TestNG plugin from last few days but i could not found any solution. Now TestNG is installed successfuly with above process.

    ReplyDelete
  5. kya ilaaj dhundha hain hats off to you buddy.

    ReplyDelete
  6. When am installing Testng plugins i got below execption eclipse.Please help me to reslove this.

    Unbound classpath container: 'JRE System Library [JavaSE-1.7]' in project 'org.testng.eclipse' org.testng.eclipse Build path Build Path Problem

    The project cannot be built until build path errors are resolved org.testng.eclipse Unknown Java Problem

    ReplyDelete
  7. Wow!!! thanks a ton I could install TestNG with the above procedure. Good stuff

    ReplyDelete
  8. Hi.I dont see plug in deployment option after I click on export

    ReplyDelete
  9. Hi. This was really cool.
    Can u pls tell me How can we do similar installation for Maven in eclipse..?

    ReplyDelete

Blogroll

Follow this blog by Email

Popular Posts