2014-10-20 127 views
2

使用硒网格的Im。当我对测试网站进行测试时,我会遇到以下错误。NUnit测试在硒网格上失败

System.InvalidOperationException : Session [(null externalkey)] not available and is not among the last 1000 terminated sessions. Active sessions are[] 

该测试不会立即失败,但会在失败之前浏览网站和不同页面。

我中心成立是批处理文件如下:

cd C:\Automated Tests\Selenium 
    java -jar selenium-server-standalone-2.43.1.jar -role hub -hubhost my.hub..ip.address  -port 4445 

我的节点设置为批处理文件如下:

cd c:\Automated Tests\Selenium\ 
java -jar selenium-server-standalone-2.43.1.jar -port 5560 -role node -nodehost  my.node.ip.address -hub http://my.hub.ip.address:4445/grid/register -browser"browserName=firefox,version=33.0,maxInstances=2,platform=WINDOWS" -nodeTimeout 600 -maxSession 10 

的Theres不是很多的信息,在这个问题上,所以任何帮助,将不胜感激

回答

0

我面临同样的问题,我找到了解决方案。

这可能是由于使用旧对象而发生的。

尝试在关闭并启动新驱动程序会话时实例化Web元素的新对象。

在这种情况下,它不会抛出过时的元素异常,但它不会在DOM中找到带有旧对象引用的web元素,从而引发错误。