对于某些浏览器,Selenium 2 中出现会话未找到错误

发布于 2024-12-02 12:33:13 字数 512 浏览 1 评论 0原文

如果这个问题含糊不清,我很抱歉,但我有一组 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

や三分注定 2024-12-09 12:33:13

我在 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 the DELETE session command is sent twice at the end of the test. The first DELETE actually deletes the session, so the second DELETE has no session to talk to.

I haven't dug into the Selenium WebDriver code enough to figure out why DELETE session is sent twice.

鹿港巷口少年归 2024-12-09 12:33:13

我正在使用 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

旧伤还要旧人安 2024-12-09 12:33:13

对于 IE,请尝试将 driver.close() 替换为 driver.quit()

这对我有帮助。当我在 IE 中使用 driver.close() 时,我遇到了类似的错误,而在 Chrome 和 Chrome 上都运行良好。火狐。

Try replacing driver.close() with driver.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.

喜你已久 2024-12-09 12:33:13

当发生这种情况时,意味着您已经关闭了网络驱动程序的旧会话。创建网络驱动程序的新实例。
即:对于 C#

var wdriver = new OpenQA.Selenium.IE.InternetExplorerDriver();

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#

var wdriver = new OpenQA.Selenium.IE.InternetExplorerDriver();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文