Webdriver MS Edge 浏览器未获取 URL

Webdriver MS Edge browser does not get URL

我尝试使用 MS Edge 浏览器导航 URL,但出现错误。 我的环境如下: Windows:10 64x 专业版。 浏览器:MS Edge 25.10586.0.0 Selenium WebDriver:2.48.2

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;

public class edgeBrowser {

  public static void main(String[] args) {

    System.setProperty("webdriver.edge.driver",
            "C:\Program Files (x86)\Microsoft Web Driver\MicrosoftWebDriver.exe");

    WebDriver driver = new EdgeDriver();
    driver.get("http://www.google.com");

  }
}

MS edge 浏览器打开但未导航到 google.com,我收到以下错误

Received a request for http://localhost:17347/session

Existing Microsoft Edge process (pid: 64400) terminated forcibly.

Waiting for new request...

Received a request for http://localhost:17347/shutdown

Stopping server.

Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: null (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 6.79 seconds

我遇到了同样的问题(如果我记得的话),我的解决方案是安装如下所示的驱动程序:

For the latest preview build from the Windows Insider Program, install this version of Microsoft WebDriver

此处列出: WebDriver for Microsoft Edge (Windows)

我们遇到了同样的问题,经过如此多的努力,我们找到了适合我们的解决方案。 Microsoft 已将 Microsoft WebDriver 设为按需功能 (FoD),以便更轻松地为您的设备获取正确的版本。 最简单的入门方法是启用开发者模式。打开“设置”应用程序,然后转到“更新和安全”、“针对开发人员”和 select“开发人员模式”。将自动安装适当版本的 WebDriver。

您还可以通过以下两种方式之一安装独立版本的 WebDriver:

从“开始”中搜索“管理可选功能”,然后select“添加功能”、“WebDriver”。 通过 DISM 通过 运行 在提升的命令中执行以下命令 prompt:DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0

您可以查看此博客中的完整步骤:https://techminionsite.com/fix-for-microsoft-webdriver-windows-10-issue/