Selenium Grid:识别发生测试失败的WebDriver节点 [英] Selenium Grid: Identify WebDriver node where a test failure occured

查看:247
本文介绍了Selenium Grid:识别发生测试失败的WebDriver节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



这通常工作得很好,但是一些测试在运行时随机失败通过硒网格。错误消息通常是读取zip文件的错误。



我们将其跟踪到测试正在使用的WebDriver节点上的一个问题 - 通常是一些弹出对话框被打开,显然阻止了测试运行。



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

  org。 openqa.selenium.WebDriverException:读取zip文件时出错; 
持续时间或超时:83毫秒
构建信息:version:'2.6.0',revision:'13840',time:'2011-09-13 16:51:41'
系统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 - 了解您的测试使用的是哪个节点,但是它更通用,询问测试本身可以在运行时找到它的机器。

可以确定您的测试(浏览器)正在运行的节点。 / p>

查看以下链接:



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 /获得宿主的-webdriver的并网节点中旁注/


We use Selenium WebDriver for testing our web app, and we run the tests via Selenium Grid 2.

This usually works well, but some tests fail randomly when run via Selenium Grid. The error message usually is "error reading zip file".

We tracked this down to a problem on the WebDriver node that the test was using - usually it was some popup dialog being open which apparently blocked the test run.

To further diagnose this issue, it would be helpful to see on what WebDriver node a test failure occured. Unfortunately, while the standard error message from the RemoteWebDriver includes version and system information, it does not include the host name:

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'

Also, this is apparently only the information for the system where the Selenium test is running, not the system where the browser is running (i.e. the WebNode).

Is there some way to find out the name of the node where the failed test was run? Or should I consider filing an enhancement request with the Selenium project?

There is a related question: Selenium 2 Grid - Knowing which node your test is using, but it's a bit more general, asking how the test itself can find its machine when it's run.

解决方案

It is possible to identify which node your test (browser) is running on.

Check out these links:

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

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

这篇关于Selenium Grid:识别发生测试失败的WebDriver节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆