Jenkins 与 Xvfb 和 Selenium - Firefox 启动但没有执行
我在 Jenkins 1.446 下使用 Selenium 和 Xvfb 时遇到问题:看起来 Firefox 已正确启动,因为我让失败的测试记录了屏幕截图。这些屏幕截图都显示相同的失败页面,在我的例子中,这是测试应该开始的起始页面。所以我猜 selenium WebDriver 命令没有到达。可能是什么原因?顺便说一句,测试在我的本地计算机上完美运行。
我使用的是 Firefox 9.0.1,没有特定的测试配置文件,也没有附加组件、Ubuntu 10.04、Senlenium 2.16.1
日志条目:com.thoughtworks.selenium.SeleniumException:等待操作完成超时
谢谢!
编辑:问题似乎可以通过系统重新启动来解决......
I have a problem with Selenium under Jenkins 1.446 together with Xvfb: It looks like firefox is started correctly because I let my failing tests record screenshots. These screenshots all show the same failing page, which in my case is the starting page where the tests should begin. So I gues the selenium WebDriver commands do not arrive. What could be the reason? By the way, the tests are running perfectly on my local machine.
I'm using Firefox 9.0.1 with no specific test profile and no AddOns, Ubuntu 10.04, Senlenium 2.16.1
Log entry: com.thoughtworks.selenium.SeleniumException: Timed out waiting for action to finish
Thanks!
EDIT: Issue seems to be fixed by a system reboot ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 FF9.0.1 和 Selenium 2.16.1 上遇到了非常类似的问题,这些问题是通过由 Jenkins 在 WinXP 节点上运行的 Maven SureFire 插件启动的 JUnit 运行的。
2.17.0 为我解决了这个问题。尝试更新到最新的 Selenium。
通过 RDP,我能够观看正在运行的测试。 Firefox 询问收集匿名使用统计信息的提示似乎部分阻止了测试。手动回答提示将允许测试继续,但由于 Selenium 默认情况下每次都会创建一个新的配置文件,因此提示将在下次浏览器启动时返回。使用预配置的 FF 配置文件在本地运行测试使我能够坚持提示已得到答复。这在我的 XP 节点上是不可能的,因为测试是作为“系统”运行的。
Selenium/WebDriver 通常会通过将提示标记为已在临时 FF 配置文件配置中回答来解决此问题,但错误导致该值设置为错误的值。您可以将配置文件配置注入 Selenium FirefoxDriver 驱动程序以实用地配置类似此提示的内容,但该错误似乎也阻止了这种情况。此问题已在 Selenium 2.17.0 中得到解决 (http://selenium.googlecode.com/svn /trunk/java/CHANGELOG 请参阅 2.17.0 WebDriver 错误修复)。
I experienced a very similar issue with FF9.0.1 and Selenium 2.16.1 running through JUnit launched by Maven SureFire plugin run by Jenkins on a WinXP node.
2.17.0 fixed the issue for me. Try updating to the latest Selenium.
Through RDP, I was able to watch the tests running. The tests appeared to be partially blocked by a prompt from Firefox asking about collecting anonymous usage statistics. Manually answering the prompt would allow the test to continue but because Selenium creates a new profile each time by default, the prompt would return on the next browser launch. Running the tests locally with a pre-configured FF profile allowed me to persist that the prompt had been answered. This isn't possible on my XP node because the tests are running as 'System'.
Selenium/WebDriver would normally take care of this for you by marking the prompt as already answered in a temporary FF profile configuration but a bug was causing the value to be set to the wrong value. You can inject a profile configuration to the Selenium FirefoxDriver driver to pragmatically configure stuff like this prompt but the bug appeared to prevent this as well. This has been resolved in Selenium 2.17.0 (http://selenium.googlecode.com/svn/trunk/java/CHANGELOG see 2.17.0 WebDriver bug fixes).