【问题标题】:Selenium Intellij not running the Testng's TestSelenium Intellij 没有运行 Testng 的测试
【发布时间】:2021-04-18 21:29:24
【问题描述】:

我有 selenium 网格设置和编码 selenium testng,但它不会在前台启动浏览器。可能是什么错误?

以下是我的配置:

clean test -Dproperty=sit-config.properties

<plugin>      
    <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
                <includes>
                    <include>GenericTestManager.java</include>
                </includes>
            </configuration>
        </plugin>


 @Test(groups= {"Login"}, description="Chrome - Login", dataProvider = "loginCredentials")
 @JSErrorsCollectorTestNG(assertJSErrors = true)
 public void test() {
        myChromeDriver.getDriver().navigate().to("www.facebook.com");
 }

请帮忙。

十亿感谢您的帮助。

【问题讨论】:

  • 还有哪个应用占据前台?
  • 这是一个仅使用 Intellij IDE 创建的 selenium testng 应用程序。
  • 对于调试,您可以使用 .添加一些调试点并在命令行中使用 -Dmaven.surefire.debug maven.apache.org/surefire/maven-surefire-plugin/examples/…
  • 也在surefire中添加 - **/GenericTestManager.java

标签: java selenium automation


【解决方案1】:

我将 GenericTestMnaager 重命名为 Tests.java 并运行。

【讨论】:

    【解决方案2】:

    您需要在调用navigate().to() 时包含协议,即https,如下所示:

    myChromeDriver.getDriver().navigate().to("https://www.facebook.com/");
    

    【讨论】:

    • 问题是surefire插件上的谎言没有拿起我的测试GenericTestManager.java。如何排除故障?
    猜你喜欢
    • 1970-01-01
    • 2014-02-04
    • 1970-01-01
    • 1970-01-01
    • 2018-03-27
    • 2017-12-22
    • 1970-01-01
    • 2017-07-22
    • 1970-01-01
    相关资源
    最近更新 更多