简体   繁体   English

如何禁用chromedriver自动更新

[英]How to disable chromedriver auto updates

One of the recurring questions I have found is "How to disable google chrome updates"我发现的反复出现的问题之一是“如何禁用谷歌浏览器更新”

After some research, renaming the update folder and making sure the service gupdate never runs does the trick.经过一番研究,重命名更新文件夹并确保服务 gupdate 永远不会运行就可以了。

The issue I am now facing is chromedriver auto-updating, after running the first test.我现在面临的问题是运行第一次测试后 chromedriver 自动更新。 relevant vstestlog相关vstestlog

Can't really find much information on this, so: Is there a way to prevent this update from happening automatically?真的找不到太多关于这方面的信息,所以:有没有办法防止这个更新自动发生?

additional info:附加信息:

The setup we use are disposable VMs that spawn and get destroyed at the end of the automated test run, these are supported by packer images.我们使用的设置是一次性虚拟机,它们在自动测试运行结束时生成并被销毁,这些由打包程序映像支持。 chrome and chromedriver are installed via chocolatey, with the version pinned. chrome 和 chromedriver 通过 Chocolatey 安装,版本固定。

We basically want to ensure automated test pipelines keep running until we address the Google chrome and chromedriver updates (create a new image) I'd also take suggestions regarding a better way of handling the version updates (automated can cause some false-negatives as the coded UI tests may not be prepared to run in it yet)我们基本上希望确保自动化测试管道继续运行,直到我们解决 Google chrome 和 chromedriver 更新(创建新图像)编码的 UI 测试可能还没有准备好在其中运行)

Webdriver manager is the solution for these drivers you don't need to download and set up path for particular browsers. Webdriver manager 是这些驱动程序的解决方案,您无需为特定浏览器下载和设置路径。 webdriver is a function that is doing webdriver 是一个 function 正在做

WebDriverManager网络驱动管理器

Maybe you can download manually webdriver from https://chromedriver.chromium.org/downloads , then extract to another directory.也许你可以从https://chromedriver.chromium.org/downloads手动下载 webdriver,然后解压到另一个目录。 Or, if you have seen this path on console, you can copy the absolute path或者,如果您在控制台上看到过此路径,则可以复制绝对路径

console image控制台图像

Then, you can pass parameter 1 in inisialization by absolute path to the executable driver that've been copied.然后,您可以通过绝对路径将参数 1 在初始化中传递给已复制的可执行驱动程序。

driver = webdriver.Chrome( "path/to/chromedriver")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM