【发布时间】:2020-07-24 13:13:24
【问题描述】:
我正在尝试通过正在使用以下命令安装 chrome 浏览器的 docker 运行 selenium 脚本:
RUN dpkg-divert --add --rename --divert /opt/google/chrome/google-chrome.real /opt/google/chrome/google-chrome \
&& echo "#!/bin/bash\nexec /opt/google/chrome/google-chrome.real --no-sandbox --disable-setuid-sandbox \"\$@\"" > /opt/google/chrome/google-chrome \
&& chmod 755 /opt/google/chrome/google-chrome
以上命令是安装chrome浏览器84版:
Setting up google-chrome-stable (84.0.4147.89-1) ...
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode
但 WebDriverManager 正在安装驱动程序版本 85:
10 [TestNG-test=StructurePhoto-1] INFO io.github.bonigarcia.wdm.WebDriverManager - Please answer the following questionnaire based on your experience with WebDriverManager. Thanks a lot!
10 [TestNG-test=StructurePhoto-1] INFO io.github.bonigarcia.wdm.WebDriverManager - ====> XXXXXXX.cc/wdm-survey <====
876 [TestNG-test=StructurePhoto-1] INFO io.github.bonigarcia.wdm.WebDriverManager - Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
1825 [TestNG-test=StructurePhoto-1] INFO io.github.bonigarcia.wdm.online.Downloader - Downloading https://chromedriver.storage.googleapis.com/85.0.4183.38/chromedriver_linux64.zip
4148 [TestNG-test=StructurePhoto-1] INFO io.github.bonigarcia.wdm.online.Downloader - Extracting binary from compressed file chromedriver_linux64.zip
6296 [TestNG-test=StructurePhoto-1] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as /root/.m2/repository/webdriver/chromedriver/linux64/85.0.4183.38/chromedriver
Starting ChromeDriver 85.0.4183.38 (9047dbc2c693f044042bbec5c91401c708c7c26a-refs/branch-heads/4183@{#779}) on port 24023
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
由于上述版本不匹配,脚本失败。 我正在使用依赖项:
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>4.0.0</version>
</dependency>
我不确定出了什么问题,有人可以帮我解决这个问题。
谢谢。
【问题讨论】:
标签: java selenium selenium-webdriver webdriver