【问题标题】:Edge WebDriver VersionEdge WebDriver 版本
【发布时间】:2020-04-29 23:47:04
【问题描述】:

如何判断您使用的是哪个版本的 Edge Web 驱动程序?

我想使用 Web 驱动程序 Microsoft Edge 44.18362.449.0、Microsoft EdgeHTML 18.18363

按照此处的说明,我这样做是为了获取 Webdriver

“通过在提升的命令提示符下运行以下命令来通过 DISM 安装:DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0”

我在 java 中使用 selenium,我使用 chrome 浏览器 selenium 进行了测试,我使用 .exe 文件访问 Web 驱动程序,但是没有提供 .exe 文件,或者我不知道它的安装位置。我在运行上面的命令时查看了我所在的目录,没有找到任何exe。

请告知我如何使用 java 和 selenium 连接到 Web 驱动程序。

【问题讨论】:

标签: selenium webdriver microsoft-edge


【解决方案1】:

您应该找到MicrosoftWebDriver.exe' atC:\Windows\System32\MicrosoftWebDriver.exe`,如下图所示。

【讨论】:

    【解决方案2】:

    是的,我同意@supputuri 的建议。

    您也可以在如下代码中直接引用路径。它也会起作用。

    例子:

    package selenium_test;
    
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.edge.*;
    import org.openqa.selenium.WebElement;
    public class new_java_class 
    {
    
            public static void main(String[] args) 
        {
    
                      System.setProperty("webdriver.edge.driver","C:\\\\Windows\\\\System32\\\\MicrosoftWebDriver.exe");
    
                      WebDriver browser = new EdgeDriver();
    
                      browser.get("https://microsoft.com");               
            }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-06-21
      • 1970-01-01
      • 2020-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-27
      相关资源
      最近更新 更多