欢迎光临散文网 会员登陆 & 注册

Applicable driver not found; attempting to install with Selenium

2023-07-27 17:18 作者:LogByMax  | 我要投稿

(认知有限,如有不妥,还望告知,欢迎讨论。)

背景情况: Win10, JS + Selenium,在执行npm test的时候报错

完整报错信息:

Applicable driver not found; attempting to install with Selenium Manager (Beta)

报错相关代码:

解决方法:

  1. 经排查(在www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/#use-the-latest-version-of-selenium 看到),我的机子没有安装chromedriver,所以需要先安装chromedriver。

  2. 先检查本机的chrome版本,

3. 然后在这里(chromedriver.storage.googleapis.com/index.html)找到最相近的chromedriver

版本

选择windows的版本下载


4. 然后解压放到本机的这个位置

并将这个位置路径配置到环境变量里

5.保存上述配置,重新打开终端,执行npm test, 成功打开chrome浏览器。


=END=

Reference:

[1] blog.csdn.net/wennie11/article/details/106327648

[2] chromedriver.storage.googleapis.com/index.html

[3] blog.csdn.net/zhoukeguai/article/details/113247342

[4] www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/#use-the-latest-version-of-selenium

Applicable driver not found; attempting to install with Selenium的评论 (共 条)

分享到微博请遵守国家法律