【问题标题】:Eclipse error message in selenium in TestNg related to maven (org.testng.eclipse.maven.Maven ...)与 maven 相关的 TestNg 中的 selenium 中的 Eclipse 错误消息(org.testng.eclipse.maven.Maven ...)
【发布时间】:2021-05-28 19:37:42
【问题描述】:

我第一次尝试使用 eclipse 的 selenium 来运行 TestNG 程序 它的代码是: 当我选择使用 TestNG 运行时 我收到以下错误消息 - 我在代码下方添加 有人可以帮我解决这个问题吗? 感谢Advanecd

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

public class google {
    @Test
    public static void main(String[] args) {
        // TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Selenium\\chromedriver.exe");
        
        WebDriver driver = new ChromeDriver();
        driver.get("http://google.com");
        driver.findElement(By.xpath("//body/div[1]/div[3]/form[1]/div[2]/div[1]/div[1]/div[1]/div[2]/input[1]")).sendKeys("1234");
        driver.findElement(By.cssSelector("div.L3eUgb:nth-child(2) div.o3j99.ikrT4e.om7nvf:nth-child(3) div:nth-child(2) div.A8SBwf:nth-child(1) div.FPdoLc.tfB0Bf:nth-child(4) center:nth-child(1) > input.gNO89b")).click();
    }

Error message

【问题讨论】:

    标签: java eclipse selenium maven testng


    【解决方案1】:

    正如本期所暗示的:Dupe issue

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

    ...暗示 TestNGMaven 相关的类文件之间存在不兼容

    从历史上看,如果在安装 testng 时您将 M2E Maven 的复选框保持选中状态,则会发生此错误。

    解决此问题的最简单方法是重新安装 TestNG,确保未选中 M2E Maven 的复选框。

    【讨论】:

      猜你喜欢
      • 2022-06-25
      • 1970-01-01
      • 2015-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-11
      • 2016-03-09
      相关资源
      最近更新 更多