我正试图在selenium网格上运行我的scalatest套件。
我正在使用selenium DSL,所以我认为唯一的选择是创建新的特性,类似于Firefox / Chrome特性:
trait RemoteFirefox extends WebBrowser with Driver{
val capability = DesiredCapabilities.firefox()
implicit val webDriver = new RemoteWebDriver(new URL("http://gridurl:4444/wd/hub"), capability)
}
我认为它至少部分有效,因为它连接到网格,但之后超时,就像它没有发送一个命令一样:
selenium-grid log:
17:45:16.317 INFO - 尝试在测试槽上创建新会话 {seleniumProtocol = WebDriver,browserName = firefox,maxInstances = 1, platform = LINUX}
17:45:24.732 WARN - 会话分机键 c1ed51ae-e241-4f0c-a4b4-5bb5c53cab74由于客户端而有TIMED OUT 不活动,将被释放。
在sbt
中可以看到同样的超时Session [c1ed51ae-e241-4f0c-a4b4-5bb5c53cab74] was terminated due to
TIMEOUT
Command duration or timeout: 121 milliseconds
Build info: version: '2.50.0', revision: '1070ace4650453d518aeb03e7a9a36c9d264a8e7', time: '2016-01-27 10:46:18'
System info: host:java.version: '1.8.0_25'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=44.0, platform=LINUX, nativeEvents=false, acceptSslCerts=true, webdriver.remote.sessionid=c1ed51ae-e241-4f0c-a4b4-5bb5c53cab74, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: c1ed51ae-e241-4f0c-a4b4-5bb5c53cab74
org.openqa.selenium.WebDriverException: Session [c1ed51ae-e241-4f0c-a4b4-5bb5c53cab74] was terminated due to TIMEOUT
Command duration or timeout: 121 milliseconds
有什么想法吗?
注意:我正在使用selenium-hub和firefox节点的最新泊坞窗图像 - 当与量角器一起使用时,网格工作正常。
答案 0 :(得分:1)
您必须设置' 超时'当您提供启动Selenium Grid Hub的命令时,参数 0 。
例如。 java -jar selenium-server-standalone-2.50.1.jar -role hub -port 4444 -timeout 0
注意:当我使用旧版本的selenium独立jar时,它对我没用。但是,我今天下载了最新版本的selenium-server-standalone-2.50.1.jar'它起作用了。