对于某些浏览器,Selenium 2 中出现会话未找到错误
如果这个问题含糊不清,我很抱歉,但我有一组 Selenium WebDriver 测试,它们目前无法在 Chrome 或 IE 中工作。无论出于何种原因,Firefox 都运行良好。
Chrome 和 IE 的错误非常相似,这令人困惑,因为我确信 Chrome 测试之前已经有效。
(是的,我的路径中确实有 chromedriver,并且它正在打开浏览器)。
基本上发生的情况是测试将运行到一半,甚至能够与页面交互。
但最终,他们都因这个错误而失败:
org.openqa.selenium.WebDriverException:
session 2fca1234-343f-45e7-af49-6486b13e1eba does not exist
我只是想知道是否有其他人看到过这个错误或类似的错误。
我环顾四周,没有发现有人遇到同样的问题。
作为记录,我正在 Java 中运行测试并使用 Selenium 2.5
I'm sorry if this question is vague, but I have a set of Selenium WebDriver tests, and they are currently not working in Chrome or IE. For whatever reason Firefox works fine.
The error is very similar for both Chrome and IE, and it is perplexing because I know for sure that the Chrome tests have worked before.
(And yes, I do have chromedriver in the path and it is opening the browser).
Basically what happens is that the tests will run partway through and are even able to interact with the page.
Eventually, though, they all fail with this error:
org.openqa.selenium.WebDriverException:
session 2fca1234-343f-45e7-af49-6486b13e1eba does not exist
I was just wondering if anyone else has seen this error or anything similar.
I have looked around quite a bit and haven't found anyone having the same issue.
For the record, I am running my tests in Java and using Selenium 2.5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在 Chrome 自动化中看到
未找到会话
错误。通过检查这些失败的日志,我确定发生错误是因为在测试结束时发送了两次 DELETE session 命令。第一个DELETE
实际上删除了会话,因此第二个DELETE
没有可对话的会话。我还没有深入研究 Selenium
WebDriver
代码,无法弄清楚为什么DELETE session
发送了两次。I've been seeing the
Session not found
error in my Chrome automation. By examining the logs from these failures, I've determined that the error occurs because theDELETE session
command is sent twice at the end of the test. The firstDELETE
actually deletes the session, so the secondDELETE
has no session to talk to.I haven't dug into the Selenium
WebDriver
code enough to figure out whyDELETE session
is sent twice.我正在使用 webdriver c# 组合来自动化我的基于 Web 的应用程序,当我执行 webDriver.Navigate().GoToUrl(URL); 时,我通常会收到该错误。并且给定的 URL 字符串不会打开任何网页
I am using webdriver c# combination to automate my web based application, I normally get that error when I do webDriver.Navigate().GoToUrl(URL); and the URL string given doesn't opens any webpage
对于 IE,请尝试将
driver.close()
替换为driver.quit()
。这对我有帮助。当我在 IE 中使用
driver.close()
时,我遇到了类似的错误,而在 Chrome 和 Chrome 上都运行良好。火狐。Try replacing
driver.close()
withdriver.quit()
for IE.This helped me. I was getting a similar error when I was using
driver.close()
with IE while was working fine with both Chrome & FireFox.当发生这种情况时,意味着您已经关闭了网络驱动程序的旧会话。创建网络驱动程序的新实例。
即:对于 C#
When this happens it means that you have closed the old session of the web driver. Create a new instance of the webdriver.
Ie: for C#