【问题标题】:Selenium Grid: Identify WebDriver node where a test failure occuredSelenium Grid:识别发生测试失败的 WebDriver 节点
【发布时间】:2011-11-28 07:57:39
【问题描述】:

我们使用 Selenium WebDriver 来测试我们的网络应用,并通过 Selenium Grid 2 运行测试。

这通常效果很好,但是通过 Selenium Grid 运行时,一些测试会随机失败。错误信息通常是“读取 zip 文件时出错”。

我们将此问题归结为测试使用的 WebDriver 节点上的问题 - 通常是某个弹出对话框打开,显然阻止了测试运行。

要进一步诊断此问题,查看在哪个 WebDriver 节点上发生了测试失败会很有帮助。不幸的是,虽然来自 RemoteWebDriver 的标准错误消息包括版本和系统信息,但它不包括主机名:

org.openqa.selenium.WebDriverException: error reading zip file;
duration or timeout: 83 milliseconds
Build info: version: '2.6.0', revision: '13840', time: '2011-09-13 16:51:41'
System info: os.name: 'Linux', os.arch: 'amd64', 
os.version: '2.6.18-194.32.1.el5', java.version: '1.6.0_20'

此外,这显然只是运行 Selenium 测试的系统的信息,而不是运行浏览器的系统(即 WebNode)。

有没有办法找出运行失败测试的节点的名称?还是我应该考虑向 Selenium 项目提交增强请求?

有一个相关的问题:Selenium 2 Grid - Knowing which node your test is using,但它更笼统一些,询问测试本身在运行时如何找到它的机器。

【问题讨论】:

标签: selenium error-handling webdriver selenium-webdriver


【解决方案1】:

可以确定您的测试(浏览器)在哪个节点上运行。

查看这些链接:

Java 和 c# 绑定: http://www.martin-walton.me.uk/2013/01/get-host-of-webdriver-grid-node/

Ruby 绑定 http://www.martin-walton.me.uk/2013/02/get-host-of-webdriver-grid-node-in-ruby/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-19
    • 1970-01-01
    相关资源
    最近更新 更多