簡體   English   中英

用於 Gradle 測試的 Selenide 遠程瀏覽器配置

[英]Selenide Remote browser config for Gradle Test

我正在准備我的項目,以便能夠在 Bitbucket + Jenkins 下啟動。 我需要使用遠程 Selenium 服務器(如 Selenoid)運行 Selenide 解決方案

如果我在 TestBase Class 中對配置進行基本設置,例如:

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

它有效,但僅在從 IntelliJ IDEA 運行時,而不是從控制台運行。

如果我運行Gradle test ,它會在本地啟動 - 而不是在網格/selenoid 上。

我嘗試將該屬性添加到gradle.properties文件中,例如:systemProp.selenide.remote 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

仍然沒有按預期工作...... :(

您對可能出現的問題有任何想法嗎? 什么應該是適當的解決方案?

工作解決方案是:

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

IntelliJ IDEA 可能還有一個額外的問題。 幾次重新啟動 + 無效/重新啟動選項后,這工作正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM