我正在远程 Jenkins Linux 机器上运行我的 Selenium CI 测试。我还使用 WebDriverManager 来管理 Chromedriver。
远程 Chrome 版本是 79.0.3945.88。这是我无权更改的内容。当 Chrome 版本从 78 更新时,我开始收到警告
07:26:19 [1579242379.444][WARNING]: This version of ChromeDriver has not been tested with Chrome version 79.
所以我更新了 Chromedriver
WebDriverManager.chromedriver().version("79.0.3945.88").setup();
但后来我会得到
09:02:35 09:02:35.908 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - The proper chromedriver version for your Google Chrome is unknown ... trying with the latest
09:02:37 09:02:36.999 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Latest version of chromedriver according to https://chromedriver.storage.googleapis.com/LATEST_RELEASE is 79.0.3945.36
09:02:37 09:02:37.030 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as /var/lib/jenkins/.m2/repository/webdriver/chromedriver/linux64/79.0.3945.36/chromedriver
并且测试仍然会失败,因为页面的 HTML 不会加载。我尝试延长等待时间,但这没有帮助。
正如这里所建议的,接下来我尝试了在https://chromedriver.chromium.org/downloads上找到的所有 Chromedriver 78 和 79 版本,但没有一个起作用。
之后,我试图找到一个精确的.88
版本并使用它
WebDriverManager.chromedriver().targetPath(" https://centos.pkgs.org/7/epel-x86_64/chromedriver-79.0.3945.88-1.el7.x86_64.rpm.html ").version("79.0.3904.88" )。设置();
但结果是:
13:33:47 13:33:47.404 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
13:33:48 13:33:48.566 [main] ERROR i.g.bonigarcia.wdm.WebDriverManager - chromedriver 79.0.3904.88 for LINUX64 not found in https://chromedriver.storage.googleapis.com/
13:33:48 13:33:48.568 [main] WARN i.g.bonigarcia.wdm.WebDriverManager - There was an error managing chromedriver 79.0.3904.88 (chromedriver 79.0.3904.88 for LINUX64 not found in https://chromedriver.storage.googleapis.com/) ... trying again using mirror
13:34:59 13:34:59.973 [main] ERROR i.g.bonigarcia.wdm.WebDriverManager - chromedriver 79.0.3904.88 for LINUX64 not found in http://npm.taobao.org/mirrors/chromedriver/
13:34:59 13:34:59.973 [main] WARN i.g.bonigarcia.wdm.WebDriverManager - There was an error managing chromedriver 79.0.3904.88 (chromedriver 79.0.3904.88 for LINUX64 not found in http://npm.taobao.org/mirrors/chromedriver/) ... trying again using latest from cache
13:35:03 13:35:03.454 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Latest version of chromedriver according to http://npm.taobao.org/mirrors/chromedriver/LATEST_RELEASE is 79.0.3945.36
13:35:53 13:35:53.530 [main] INFO io.github.bonigarcia.wdm.Downloader - Downloading http://npm.taobao.org/mirrors/chromedriver/79.0.3945.36/chromedriver_linux64.zip
13:35:54 13:35:54.771 [main] INFO io.github.bonigarcia.wdm.Downloader - Extracting binary from compressed file chromedriver_linux64.zip
我还将 WebDriverManager 从 3.2.0 更新到 3.7.0,最后更新到 3.8.1,但没有任何帮助。
有没有办法让我加载79.0.3945.88.
Chromedriver 的精确版本?
还是有其他解决方法?