Applicable driver not found; attempting to install with Selenium
(认知有限,如有不妥,还望告知,欢迎讨论。)
背景情况: Win10, JS + Selenium,在执行npm test的时候报错
完整报错信息:
Applicable driver not found; attempting to install with Selenium Manager (Beta)
报错相关代码:
解决方法:
经排查(在www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/#use-the-latest-version-of-selenium 看到),我的机子没有安装chromedriver,所以需要先安装chromedriver。
先检查本机的chrome版本,

版本

选择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