TestNG An internal error occurred during launching

Sug picture Sug · Dec 2, 2015 · Viewed 31k times · Source

I created a TestNG class (FirstTest.java) and when I run the test case as TestNG Test, I am getting the following error.

An internal error occurred during: "Launching FirstTest". java.lang.NullPointerException

Eclipse Version: Luna Service Release 2 (4.4.2)

If anyone knows Please Help!

Answer

Michael picture Michael · Dec 3, 2015

I encountered a problem with similar symptoms today. I'm not sure if it is the same problem but it matches everything in your question.

In my case, the log files said:

!ENTRY org.eclipse.core.jobs 4 2 2015-12-03 15:49:19.369
!MESSAGE An internal error occurred during: "Launching NewTest".
!STACK 0
java.lang.NullPointerException
at org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider.getVMArgsFromPom(MavenTestNGLaunchConfigurationProvider.java:74)

So my problem was that the TestNG-plugin in Eclipse failed to find the pom-file, as I don't use Maven. Anyway, after uninstalling the optional M2E (Maven...) part of the TestNG Eclipse plugin I could run my TestNG test cases successfully.

If you have the same issue, you uninstall the M2E part in Eclipse by selecting

  • Help
  • Install new software...
  • What is already installed?
  • Select the TestNG M2E software and click uninstall

Hope this helps!