我正在准备我的项目,以便能够在Bitbucket + Jenkins下启动。我需要使用远程Selenium运行Selenide解决方案(比如Selenoid)
如果我在TestBase类中做了一个基本的配置设置,比如:
public void beforeTest(){
Configuration.remote = "http://localhost:4444/wd/hub";
}它正在工作,但只在从IntelliJ IDEA运行时,而不是从控制台运行时。
如果我运行Gradle test,它是在本地启动的,而不是在网格/硒体上启动的。
我试图将该属性添加到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
但还是没有像预期的那样工作..。:(
你对什么可能是错的有什么想法吗?什么才是正确的解决办法?
发布于 2021-04-13 10:43:23
工作解决办法是:
systemProperty("selenide.remote", "http://0.0.0.0:4444/wd/hub")IntelliJ的想法可能还有另外一个问题。在很少重新启动+失效/重新启动选项之后,这个选项将正常工作。
https://stackoverflow.com/questions/67008921
复制相似问题