ChromeDriver 仅支持 Chrome 89 版 [英] ChromeDriver only supports Chrome version 89
问题描述
使用 Azure DevOps,不知何故管道停止工作,当我运行 ng lint && 时,我无法完成测试.ng e2e &&ng 测试 --watch=false
.这在本地运行时有效.
Using Azure DevOps, somehow the pipeline just stop working and I can't get the test done when I run ng lint && ng e2e && ng test --watch=false
. This it's working when running local.
[16:43:25] I/launcher - Running 1 instances of WebDriver
[16:43:25] I/direct - Using ChromeDriver directly...
[16:43:27] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 89
Current browser version is 88.0.4298.0 with binary path D:\a\1\s\node_modules\puppeteer\.local-chromium\win64-818858\chrome-win\chrome.exe
(Driver info: chromedriver=89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294}),platform=Windows NT 10.0.17763 x86_64)
[16:43:27] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 89
Current browser version is 88.0.4298.0 with binary path D:\a\1\s\node_modules\puppeteer\.local-chromium\win64-818858\chrome-win\chrome.exe
(Driver info: chromedriver=89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294}),platform=Windows NT 10.0.17763 x86_64)
at Object.checkLegacyResponse (D:\a\1\s\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (D:\a\1\s\node_modules\selenium-webdriver\lib\http.js:509:13)
at D:\a\1\s\node_modules\selenium-webdriver\lib\http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:93:5)
From: Task: WebDriver.createSession()
at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\chrome.js:761:15)
at Direct.getNewDriver (D:\a\1\s\node_modules\protractor\built\driverProviders\direct.js:77:33)
at Runner.createBrowser (D:\a\1\s\node_modules\protractor\built\runner.js:195:43)
at D:\a\1\s\node_modules\protractor\built\runner.js:339:29
at _fulfilled (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:834:54)
at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:863:30
at Promise.promise.promiseDispatch (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:796:13)
at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:137:13)
[16:43:27] E/launcher - Process exited with error code 199
##[error]Cmd.exe exited with code '1'.
这就是我设置管道任务的方式
This is how I set the pipeline task
傀儡师
cd node_modules/puppeteer
npm install
npm install webdriver-manager@latest
> puppeteer@5.5.0 install D:\a\1\s\node_modules\puppeteer
> node install.js
Chromium is already in D:\a\1\s\node_modules\puppeteer\.local-chromium\win64-818858; skipping download.
> puppeteer@5.5.0 prepare D:\a\1\s\node_modules\puppeteer
> node typescript-if-required.js
added 848 packages from 915 contributors and audited 860 packages in 43.745s
96 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Finishing: npm install puppeteer
ng 测试
ng lint && ng e2e && ng test --watch=false
推荐答案
根据文档:Microsoft Windows Server 2019 Datacenter 和 Ubuntu 20.04.2 LTS.我们发现我们的托管代理上只有 ChromeDriver 88.0.4324.96.
According the doc: Microsoft Windows Server 2019 Datacenter and Ubuntu 20.04.2 LTS. We find there is only ChromeDriver 88.0.4324.96 on our hosted agent.
所以我们有两个建议:
我们注意到测试在您的本地机器上运行良好,因此我们可以尝试在您的本地机器上安装一个自代理,然后使用新代理再试一次.
We noticed that the test is working well on your local machine, so we can try to install a self-agent in your local machine and use the new agent to try again.
我们可以添加一个 bash 任务并使用下面的脚本先安装最新版本的 ChromeDriver.
We can add a bash task and use the below the script to install latest version of the ChromeDriver first.
npm 安装 chromedriver --chromedriver_cdnurl=https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_win32.zip
npm install chromedriver --chromedriver_cdnurl=https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_win32.zip
这篇关于ChromeDriver 仅支持 Chrome 89 版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!