使用 Selenium 的 Chrome 驱动程序错误:无法发现打开的页面 [英] Chrome Driver Error using Selenium: Unable to Discover Open Pages

查看:32
本文介绍了使用 Selenium 的 Chrome 驱动程序错误:无法发现打开的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行 Selenium 测试时遇到与 Chrome 驱动程序相关的错误.错误消息是Unable to Discover Open Pages." Selenium 测试一直运行良好,直到昨晚.问题似乎是在前一天重新启动服务器后开始的.我无法在本地机器上重现此错误.从服务器上的命令行运行 Selenium 测试确实会打开 Chrome 浏览器,但会导致相同的错误.有什么想法吗?

I'm getting a Chrome Driver related error when running my Selenium tests. The error message is "Unable to Discover Open Pages." The Selenium tests were all running fine until last evening. The problem seemed to begin after a reboot of the server the day before. I cannot reproduce this error on my local box. Running the Selenium tests from the command line on the server does open the Chrome Browser but results in the same error. Any ideas?

失败的线路:

chromeDriver = new OpenQA.Selenium.Chrome.ChromeDriver(externalDriverPath);

错误消息和堆栈跟踪:

无法发现打开的页面(驱动程序信息:chromedriver=2.1,平台=Windows NT 6.1 SP1 x86_64)在OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(响应错误响应)在OpenQA.Selenium.Remote.RemoteWebDriver.Execute(字符串driverCommandToExecute,Dictionary`2 参数)在OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities所需能力)在OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutorcommandExecutor,ICapabilities 期望能力)在OpenQA.Selenium.Chrome.ChromeDriver..ctor(字符串chromeDriverDirectory,ChromeOptions 选项)在OpenQA.Selenium.Chrome.ChromeDriver..ctor(字符串chromeDriverDirectory) 在 SeleniumTests.BaseTest.SetupBrowsers()

unable to discover open pages (Driver info: chromedriver=2.1,platform=Windows NT 6.1 SP1 x86_64) at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory, ChromeOptions options) at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory) at SeleniumTests.BaseTest.SetupBrowsers()

创建 ChromeDriver 实例时,会出现一个控制台窗口.出现错误的服务器似乎指的是未实现的东西.

When creating an instance of the ChromeDriver, a console window appears. The server with the error seems to refer to things NOT IMPLEMENTED.

来自服务器的 ChomeDriver 输出错误:

在端口 2984 上启动 ChromeDriver (v2.1)[4700:4292:0108/111503:ERROR:gpu_info_collector_win.cc(102)] 不能检索有效的 WinSAT 评估.[4700:4292:0108/111503:ERROR:chrome_views_delegate.cc(176)] 不是实施的[4700:4292:0108/111503:ERROR:desktop_root_window_host_win.cc(746)] 不是实施 ED [0108/111504:ERROR:gl_surface_egl.cc(132)] eglInitialize失败,错误 UNKNO WN [0108/111504:ERROR:gl_surface_win.cc(97)]GLSurfaceEGL::InitializeOneOff 失败.

Started ChromeDriver (v2.1) on port 2984 [4700:4292:0108/111503:ERROR:gpu_info_collector_win.cc(102)] Can't retrieve a va lid WinSAT assessment. [4700:4292:0108/111503:ERROR:chrome_views_delegate.cc(176)] NOT IMPLEMENTED [4700:4292:0108/111503:ERROR:desktop_root_window_host_win.cc(746)] NOT IMPLEMENT ED [0108/111504:ERROR:gl_surface_egl.cc(132)] eglInitialize failed with error UNKNO WN [0108/111504:ERROR:gl_surface_win.cc(97)] GLSurfaceEGL::InitializeOneOff failed.

我的电脑上的 ChomeDriver 输出运行良好:

在端口 18786 上启动 ChromeDriver (v2.1)[884540:883760:0108/114010:ERROR:gpu_info_collector_win.cc(102)] 不能检索有效的 WinSAT 评估.[884992:884996:0108/114010:ERROR:base_feature_provider.cc(122)]manifestTypes:允许 web_page 上下文需要提供一个值比赛.[885232:885236:0108/114011:ERROR:base_feature_provider.cc(122)]manifestTypes:允许 web_page 上下文需要提供一个值比赛.[884540:883760:0108/114011:ERROR:base_feature_provider.cc(122)]manifestTypes:允许 web_page 上下文需要提供一个值比赛.[0108/114011:错误:gl_surface_egl.cc(131)] eglInitialize失败,错误 UNKNO WN [0108/114011:ERROR:gl_surface_win.cc(54)]GLSurfaceEGL::InitializeOneOff 失败.

Started ChromeDriver (v2.1) on port 18786 [884540:883760:0108/114010:ERROR:gpu_info_collector_win.cc(102)] Can't retrieve a valid WinSAT assessment. [884992:884996:0108/114010:ERROR:base_feature_provider.cc(122)] manifestTypes: A llowing web_page contexts requires supplying a value for matches. [885232:885236:0108/114011:ERROR:base_feature_provider.cc(122)] manifestTypes: A llowing web_page contexts requires supplying a value for matches. [884540:883760:0108/114011:ERROR:base_feature_provider.cc(122)] manifestTypes: A llowing web_page contexts requires supplying a value for matches. [0108/114011:ERROR:gl_surface_egl.cc(131)] eglInitialize failed with error UNKNO WN [0108/114011:ERROR:gl_surface_win.cc(54)] GLSurfaceEGL::InitializeOneOff failed.

推荐答案

您正在使用 高度 过时的 ChromeDriver 版本.您的第一站应该是在这里更新它.

You are using a highly outdated version of the ChromeDriver. Your first port of call should be to update it here.

我高度怀疑问题在于您服务器上的 Chrome 已更新,而 ChromeDriver v2.1 没有 支持任何最新版本的 Chrome.

I would highly suspect the problem is your Chrome on your server has updated, and ChromeDriver v2.1 doesn't support any recent versions of Chrome.

这篇关于使用 Selenium 的 Chrome 驱动程序错误:无法发现打开的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆