ABHISHEK DAS
ABHISHEK DAS

Reputation: 63

How to fix the error org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider.getClasspath(Lorg/eclipse/debug/core/ILaunchConfiguration;)

I have written a code which just opens an webpage and validates whether the page's title matches with the expected string or not.

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;

public class NewTest {
     public String website = "https://opensource-demo.orangehrmlive.com/";
     WebDriver driver = new ChromeDriver();
  @Test
  public void f() {
      String actual = driver.getTitle();
      String expected = "OrangeHRM";
      Assert.assertEquals(actual, expected);
  }
  @BeforeTest
  public void beforeTest() {
      driver.get(website);
  }

  @AfterTest
  public void afterTest() {
      driver.close();
  }

}

Now while running the code there is popup window stating an internal error { An internal error occurred during: "Launching NewTest". org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider.getClasspath(Lorg/eclipse/debug/core/ILaunchConfiguration;)Ljava/util/List; }

Upvotes: 3

Views: 9256

Answers (3)

Sujit
Sujit

Reputation: 319

This is the error you receive for the incompatibility for Eclipse and TestNG and Maven.

Simplest Way to resolve this error is

  1. Open Eclipse
  2. Click on Help
  3. Click on About Eclipse
  4. On this Pop-up click on -> Installed Application
  5. Search TestNG
  6. Select TestNG and click on Checkbox of TestNG M2M(Optional) and Uninstall this component
  7. Restart the Eclipse
  8. This issue is Resolved

Upvotes: 0

Ashish Goyal
Ashish Goyal

Reputation: 59

  1. Open eclipse -> Click on Help -> Click on Installation details -> Search for TestNg M2E(optional) -> Select that and click on Uninstall.
  2. Restart your eclipse and rerun your testNg file.

Upvotes: 4

undetected Selenium
undetected Selenium

Reputation: 193138

This error message...

An internal error occurred during: "Launching NewTest"
org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider.getClasspath(Lorg/eclipse/debug/core/ILaunchConfiguration;)Ljava/util/List;

...implies that there was incompatibility between TestNG and Maven related classfiles.

Historically, this error would occur if while installing you have kept the checkbox for M2E Maven as checked.

The easiest approach to address this issue would be to reinstall the TestNG ensuring that the checkbox for M2E Maven is kept unchecked.

Upvotes: 7

Related Questions