开发者

Selenium Grid: Identify WebDriver node where a test failure occured

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 - Kn开发者_StackOverflow社区owing 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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜