1503556834416 geckodriver INFO geckodriver 0.18.0
1503556834420 geckodriver INFO Listening on 127.0.0.1:13167
1503556834659 geckodriver::marionette INFO Starting browser /usr/bin/firefox with args ["-marionette"]
Error: GDK_BACKEND does not match available displays
的测试是Spring Boot webapp的一部分,托管在Tomcat 8.5.20中。测试执行是通过调用Spring Boot webapp的url链接触发的。 与geckodriver使用火狐浏览器,这是导致该错误的代码:
System.setProperty("webdriver.gecko.driver", "/opt/geckodriver");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.yahoo.com");
服务器有LXDE Debian的8 OS为桌面环境。 无论我怎么把这个web应用链接:远程服务器上1,使用远程桌面客户端从我的本地机器,只是调用此链接:
ssh登录和使用猞猁远程服务器
上执行tightvncserver在远程服务器上安装了火狐
只是从我的本地机器调用远程URL
...即时得到总是GDK_BACKEND不匹配可用的显示器 错误。
在我的本地环境中(唯一的区别是测试是不同的Linux操作系统;其他的像Tomcat,webapp,geckodriver等版本是一样的),这个测试没有任何问题。这是日志片段:
1503556181640 geckodriver INFO geckodriver 0.18.0
1503556181643 geckodriver INFO Listening on 127.0.0.1:18039
1503556181805 geckodriver::marionette INFO Starting browser /usr/lib64/firefox/firefox with args ["-marionette"]
1503556182440 Marionette INFO Listening on port 44917
08:29:43.198 [Forwarding newSession on session null to remote] INFO org.openqa.selenium.remote.ProtocolHandshake - Detected dialect: W3C
... and now the test is executed ...
我想它与远程服务器的配置和连接无关硒,但不知道该做下一个什么IM ...
2017-08-24
StephanM