运行测试时 Selenium RC 错误
在 seleniums Bromine 中运行多个测试时出现此错误,selenium RC 版本 1.0.2 输出以下内容:
WARN - GET /selenium-server/driver/?cmd=testComplete&1=&2=&sessionId=1274d41621c64fc08c1e7ea0a58f260b HTTP/1.0 java.lang.IllegalStateException:意外命令 json={command:"open",target:"/Library/Security/Login.aspx?ReturnUrl=%2fIndex.aspx",value:""} 在新命令之前到位selectWindow 可以添加在 org.openqa.selenium.server.CommandQueue.doCommandWithoutWaitingForARe 响应(CommandQueue.java:121)
任何想法
I get this error when running a number of tests in seleniums Bromine, The selenium RC version 1.0.2 outputs this:
WARN - GET /selenium-server/driver/?cmd=testComplete&1=&2=&sessionId=1274d41621c64fc08c1e7ea0a58f260b HTTP/1.0 java.lang.IllegalStateException: unexpected command json={command:"open",target:"/Library/Security/Login.aspx?ReturnUrl=%2fIndex.aspx",value:""} in place before new command selectWindow could be added at org.openqa.selenium.server.CommandQueue.doCommandWithoutWaitingForARe
sponse(CommandQueue.java:121)
Any ideas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最近我不得不在我们的测试环境中跟踪这个问题,看来原因是 Firefox 崩溃了。如果此错误发生在两个“命令超时”异常之后,则您的浏览器可能崩溃或挂起。
在检查 Selenium RC 的代码后,我意识到当命令队列溢出时会出现“意外命令”错误。这可能是由于浏览器缺乏响应造成的,因此如果浏览器崩溃,您最终会收到此错误。
检查您的 dmesg 日志(或其他一些日志,如果不是在 Linux 下)以查看是否有任何可疑内容。就我而言,有这样的条目:
libxul.so 和plugin-container 是Firefox 的模块。将其升级到新版本对我的情况有所帮助。
Recently I had to track this problem on our testing environment and it appears, that the reason was Firefox crashing. If this error follows two 'Command timed out' exceptions, then your browser probably crashed or hanged.
Upon inspection of code of Selenium RC I realized that 'Unexpected command' error appears when there is an overflow in command queue. This can be caused by lack of responses from the browser, so if browser crashes, you end up receiving this error.
Check your dmesg logs (or some other logs, if not under Linux) to see, if there is anything suspicious. In my case there were entries like this:
libxul.so and plugin-container are modules of Firefox. Upgrading it to newer version helped in my case.
我也经常看到这个 IllegalStateException。它的发生似乎是随机的,就好像 Selenium 中的某些内容没有正确同步一样。我已经多次看到它与调用 selenium 进行屏幕捕获的 TestNG Listener 相关,但同样,它是不可预测的。
I'm also seeing this IllegalStateException, much too frequently. Its occurrence seems random, as if something in Selenium isn't synchronized properly. I have seen it several times in connection with a TestNG Listener that calls selenium to do a screen capture, but again, it's unpredictable.