簡體   English   中英

org.openqa.selenium.WebDriverException: unknown error: cannot find MSEdge binary error using EdgeDriver 和 Selenium 在 Mac 上通過 Java

[英]org.openqa.selenium.WebDriverException: unknown error: cannot find MSEdge binary error using EdgeDriver and Selenium on Mac through Java

我無法使用 Selenium Remote web 驅動程序在 MAC 上運行 MS Edge 測試。

我嘗試為邊緣二進制文件設置系統屬性,如下所示:

dc = DesiredCapabilities.edge();
System.setProperty("webdriver.edge.driver", "/Users/username/Softwares/Work/jars/msedgedriver");
dc.setCapability("edge_binary","/Applications/Microsoft Edge Beta.app");

我檢查了我安裝的 msedge 驅動程序版本和 MS Edge 瀏覽器版本。 兩者都是 - 80.0.361.48

這是 Selenium 節點上的日志:

020-02-11 18:06:37.533:INFO:osjshC.ROOT:qtp1800659519-12: org.openqa.selenium.remote.server.WebDriverServlet-59309333: 初始化 WebDriverServlet 18:06:37.551 信息 - 找到處理程序:org.openqa .selenium.remote.server.commandhandler.BeginSession@47c6497e 18:06:37.555 信息-/會話:在/會話上執行 POST(處理程序:BeginSession)18:06:37.632 信息-能力是:能力 {MicrosoftEdge_binary:/Applications/Microsoft Edge...,瀏覽器名稱:MicrosoftEdge,平台:MAC,版本:} 18:06:37.633 信息 - 功能 {MicrosoftEdge_binary:/Applications/Microsoft Edge...,瀏覽器名稱:MicrosoftEdge,平台:MAC,版本:} 匹配 class 組織.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.edge.EdgeDriverService) 啟動 MSEdgeDriver 80.0.361.48 (e1a3ff36578e440880567e6adcbeab38ec2956fa) 僅在端口 local8 上允許連接請保護MSEdgeDriver及相關測試框架使用的端口,防止被惡意代碼訪問。

運行代碼時出現的異常是

org.openqa.selenium.WebDriverException:未知錯誤:找不到 MSEdge 二進制構建信息:版本:'3.7.1',修訂:'8a0099a',時間:'2017-11-06T21:07:36.161Z' 系統信息:主機: '****-MacBook-Pro.local', ip: 'fe80:0:0:0:14d9:68c6:7d2c:87a%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.2', java.version: '1.8.0_152' 驅動程序信息: driver.version: unknown

這個錯誤信息...

org.openqa.selenium.WebDriverException: unknown error: cannot find MSEdge binary 
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z' 
System info: host: '****-MacBook-Pro.local', ip: 'fe80:0:0:0:14d9:68c6:7d2c:87a%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.2', java.version: '1.8.0_152' 
Driver info: driver.version: unknown

...暗示該程序無法在您的系統中找到 MSEdge 二進制文件。

您的主要問題是您使用的二進制文件版本之間不兼容,如下所示:

  • 盡管您使用的是MS Edge Driver v80.0MS Edge Browser v80.0的兼容版本
  • 您的Selenium 客戶端版本是2017-11-06T21:07:36.161Z3.7.1 ,比它早了將近2.5年。
  • 但是您的JDK 版本1.8.0_152 ,這是非常古老的。

因此, JDK v8u152、Selenium Client v'3.7.1MS Edge Driver v80.0MS Edge Browser v80.0之間存在明顯的不匹配


解決方案

確保這件事:

  • JDK升級到當前級別JDK 8u241
  • Selenium升級到當前級別版本 3.141.59
  • 重新啟動系統
  • 非 root用戶身份執行@Test

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM