[英]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".现在在运行代码时会弹出 window 说明内部错误 { 期间发生内部错误:“启动 NewTest”。 org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider.getClasspath(Lorg/eclipse/debug/core/ILaunchConfiguration;)Ljava/util/List;
org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider.getClasspath(Lorg/eclipse/debug/core/ILaunchConfiguration) }
}
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. ...暗示TestNG和Maven相关的类文件之间存在不兼容。
Historically, this error would occur if while installing testng you have kept the checkbox for M2E Maven
as checked .从历史上看,如果在安装testng时将
M2E Maven
的复选框保持为选中状态,则会发生此错误。
The easiest approach to address this issue would be to reinstall the TestNG ensuring that the checkbox for M2E Maven
is kept unchecked .解决此问题的最简单方法是重新安装TestNG ,确保未选中
M2E Maven
的复选框。
This is the error you receive for the incompatibility for Eclipse and TestNG and Maven.这是由于 Eclipse 和 TestNG 和 Maven 不兼容而收到的错误。
Simplest Way to resolve this error is解决此错误的最简单方法是
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.