Reputation: 63
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
Reputation: 319
This is the error you receive for the incompatibility for Eclipse and TestNG and Maven.
Simplest Way to resolve this error is
Upvotes: 0
Reputation: 59
Upvotes: 4
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 testng 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