我有一个运行 Karma 与木偶的角度项目,偶尔我得到以下错误
[11:13:43] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 93
Current browser version is 92.0.4515.107 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
(Driver info: chromedriver=93.0.4577.15 (660fc11082ba57405eca2e8c49c3e1af756fbfae-refs/branch-heads/4577@{#203}),platform=Windows NT 10.0.17763 x86_64)
[11:13:43] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 93
Current browser version is 92.0.4515.107 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
(Driver info: chromedriver=93.0.4577.15 (660fc11082ba57405eca2e8c49c3e1af756fbfae-refs/branch-heads/4577@{#203}),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 pHttpResponse (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 (node:internal/process/task_queues:96: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\q\q.js:834:54)
at D:\a\1\s\node_modules\q\q.js:863:30
at Promise.promise.promiseDispatch (D:\a\1\s\node_modules\q\q.js:796:13)
at D:\a\1\s\node_modules\q\q.js:556:49
at runSingle (D:\a\1\s\node_modules\q\q.js:137:13)
[11:13:43] E/launcher - Process exited with error code 199
似乎每次chromedrive都会出现新版本。
这是我的设置
e2e / protractor.conf.js
module.exports = function (config) {
process.env.CHROME_BIN = require('puppeteer').executablePath();
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
...
],
...
browsers: ['ChromeHeadless'],
...
customLaunchers: {
headlessChrome: {
base: "ChromeHeadless",
flags: [
"--disable-dev-shm-usage",
"--disable-extensions",
"--disable-gpu",
"--disable-web-security",
"--headless",
"--js-flags=--max-old-space-size=8196",
"--no-proxy-server",
"--no-sandbox",
],
}
}
});
};
我的问题是,是否有一个配置来避免每个新的chromedrive版本的错误?
ChromeDriver only supports Chrome version 89是的,每次发布新版本时,您都需要下载并放入驱动程序路径或类似路径,我不知道是否存在带有 pip 的命令,以便更轻松地完成。Chrome Driver version Download
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(6条)