【问题标题】:Selenide Remote browser config for Gradle Test用于 Gradle 测试的 Selenide 远程浏览器配置
【发布时间】:2021-07-04 14:45:05
【问题描述】:

我正在准备我的项目,以便能够在 Bitbucket + Jenkins 下启动。 我需要使用远程 Selenium 服务器(如 Selenoid)运行 Selenide 解决方案

如果我在 TestBase 类中对配置进行基本设置,例如:

    public void beforeTest(){    
        Configuration.remote = "http://localhost:4444/wd/hub";     
    }

只有在从 IntelliJ IDEA 而非控制台运行时才能工作。

如果我运行 Gradle test,它将在本地启动 - 而不是在网格/selenoid 上。

我尝试将该属性添加到 gradle.properties 文件中,例如: systemProp.selenide.remote=http://localhost:4444/wd/hub 但这也不起作用。

与 build.gradle 文件相同。我尝试了很多选择:

systemProperty("selenide.remote", "http://localhost:4444/wd/hub")
systemProperties['selenide.remote'] = 'http://localhost:4444/wd/hub'
System.setProperty("selenide.remote", "http://localhost:4444/wd/hub")

所有这些都不适合我。

我使用了从控制台添加到 Gradle 的属性:

gradle clean test -Dselenide.remote=http://localhost:4444/wd/hub

这仍然没有按预期工作...... :(

您对可能出现的问题有任何想法吗? 什么应该是适当的解决方案?

【问题讨论】:

    标签: gradle selenide selenoid selenium-remotedriver


    【解决方案1】:

    有效的解决方案是:

    systemProperty("selenide.remote", "http://0.0.0.0:4444/wd/hub")
    

    IntelliJ IDEA 可能存在其他问题。几次重新启动 + 无效/重新启动选项后,这工作正常。

    【讨论】:

      猜你喜欢
      • 2018-12-10
      • 2022-06-29
      • 2020-07-08
      • 2016-11-30
      • 1970-01-01
      • 1970-01-01
      • 2020-03-31
      • 2015-06-25
      • 1970-01-01
      相关资源
      最近更新 更多