相关疑难解决方法(0)

org.openqa.selenium.WebDriverException:未知错误:尝试启动Chrome浏览器时,DevToolsActivePort文件不存在

我正在尝试使用URL启动chrome,浏览器启动,之后它什么都不做.

我在1分钟后看到以下错误:

Unable to open browser with url: 'https://www.google.com' (Root cause: org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
  (Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
Run Code Online (Sandbox Code Playgroud)

我的配置:

Chrome:66 ChromeBrowser:2.39.56

PS在Firefox中一切正常

selenium google-chrome webdriver selenium-chromedriver selenium-webdriver

120
推荐指数
16
解决办法
11万
查看次数

Selenium超时从渲染器接收消息

在Chrome昨天发布最新版本(64.0.3282)之后,我现在偶尔会收到此错误:

超时从渲染器接收消息:600.000

我在一个docker容器中运行了大约2,000个selenium测试,我看到这个失败的速度大约是100 in 100.据我所知,没有可重现的步骤 - 每次迭代失败的测试都不同.我更新到最新的Chromedriver(2.35),但这似乎没有任何影响.我之前使用的是Selenium 2.41,但已更新到最新版本(3.8.1),希望它可能有所帮助......它没有.我完全不知道为什么会发生这种情况.有没有其他人注意到这一点?这可能是Chrome最新版本的错误吗?

提前感谢您提供的任何帮助.

selenium google-chrome selenium-chromedriver

20
推荐指数
7
解决办法
2万
查看次数

无法从超时获得自动化扩展:超时从渲染器接收消息

使用Selenium Webdriver(C#)我不时会收到下一个错误:

System.InvalidOperationException:未知错误:无法从超时获取自动化扩展:超时从渲染器接收消息:-3.959(会话信息:chrome = 37.0.2062.120)(驱动程序信息:chromedriver = 2.10.267521,platform = Windows NT 6.2 x86_64)

出现这种错误的方式:

OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)位于c:\ Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:第1048行OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,Dictionary "2个参数"在c:\ Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:第865行的AutomatedTests.DriverCover..ctor(IWebDriver驱动程序)

所以,它发生在下一段代码中:

 public class DriverCover
 {
        public DriverCover(IWebDriver driver)
        {
            _driver = driver;

            _driver.Manage().Window.Maximize(); //There is my mistake
        }

        private readonly IWebDriver _driver;
 }
Run Code Online (Sandbox Code Playgroud)

我使用这个类作为PageObject类的基类,我使用PageFactory来初始化网页的元素.

我有chromedriver v.2.10和Google Chrome v.37.0.2062.120 m

另外:在同一行我得到了另一个错误:

OpenQA.Selenium.WebDriverException:对远程WebDriver服务器的URL请求http://localhost:62407/session/021e05cd4c89abedb2abc77342b3bd7c/window/current/maximize在60秒后超时.----> System.Net.WebException:该操作在c:\ Projects\webdriver\dotnet\src\webdriver\Remote\HttpCommandExecutor.cs:line中的OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest请求)已超时. 152,OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(命令commandToExecute)位于c:\ Projects\webdriver\dotnet\src\webdriver\Remote\DriverServiceCommandExecutor.cs:第73行,OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute) ,字典`2参数)在c:\ Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:877行AutomatedTests.DriverCover..ctor(IWebDriver驱动程序)

selenium webdriver selenium-chromedriver selenium-webdriver

13
推荐指数
1
解决办法
3万
查看次数

在执行一段时间后,Selenium 为所有网站提供“从渲染器接收消息超时”

我有一个应用程序,我需要一个长时间运行的Selenium Web 驱动程序实例(我在无头模式下使用Chrome 驱动程序 83.0.4103.39)。基本上,该应用程序不断从队列中提取 url-data,并将提取的 url 提供给 Selenium,Selenium 应该在网站上执行一些分析。许多这些网站可能已关闭、无法访问或损坏,因此我将页面加载超时设置为 10 秒,以避免 Selenium 永远等待页面加载。
我在这里遇到的问题是,经过一些执行时间(假设 10 分钟)Selenium 开始给出Timed out receiving message from renderer每个 url 的错误。最初它工作正常,它可以正确打开好的网站并在坏网站上超时(网站无法加载),但一段时间后它开始对所有内容超时,即使是应该正确打开的网站(我已经检查过,它们在 Chrome 浏览器上正确打开)。我很难调试这个问题,因为应用程序中的每个异常都被正确捕获。我也注意到这个问题只发生在headless模式中。

  • 更新 *
    在网站分析期间,我还需要考虑 iframe(仅顶级),因此我还添加了一个逻辑来将驱动程序上下文切换到主页中的每个 iframe 并提取相关的 html。

这是应用程序的简化版本:

import traceback
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By

width = 1024
height = 768

chrome_options = Options()
chrome_options.page_load_strategy …
Run Code Online (Sandbox Code Playgroud)

python iframe selenium renderer selenium-chromedriver

7
推荐指数
1
解决办法
6065
查看次数

从渲染器接收消息超时:600.000 当我们使用 Jenkins windows 服务模式执行 selenium 脚本时

我们每天都在使用 jenkins 窗口服务(无头模式)执行我们的 selenium 自动化脚本。它一直工作到昨天。突然它停止工作并且没有启动浏览器。它显示了以下错误消息 [15536​​77874.187][SEVERE]:从渲染器接收消息超时:600.000。之后所有剩余的测试用例都失败了。

如果我们在没有 Windows 服务的情况下使用 jenkins 运行构建,它工作正常。我们仅在使用 Windows 即服务时遇到此问题

  • 我的 chrome 驱动版本:73.0.3683.68
  • Chrome 浏览器版本:73.0.3683.68
  • 硒版本:3.14.0

我试图降级浏览器版本和驱动程序版本。即使它不起作用

当我们使用 jenkins 作为 Windows 服务执行但收到错误消息时,我希望浏览器应该在后台启动。

System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("load-extension=C:\\1.13.4_0");
options.addArguments("--start-maximized");
options.addArguments("--ignore-certificate-errors");
options.addArguments("--disable-popup-blocking");
// options.addArguments("window-size=1400,600");
options.addArguments("enable-automation");
options.addArguments("--headless");
options.addArguments("--window-size=1920,1080");
options.addArguments("--no-sandbox");
// options.addArguments("--disable-extensions");
options.addArguments("--dns-prefetch-disable");
options.addArguments("--disable-gpu");
options.setPageLoadStrategy(PageLoadStrategy.NORMAL);
DesiredCapabilities capabilities = 
DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, 
**strong text**options);
return new ChromeDriver(capabilities);
Run Code Online (Sandbox Code Playgroud)

service selenium window jenkins selenium-chromedriver

6
推荐指数
1
解决办法
8327
查看次数