【问题标题】:Getting SessionNotCreatedError with protractor and Angular 8使用量角器和 Angular 8 获取 SessionNotCreatedError
【发布时间】:2020-02-11 18:42:09
【问题描述】:

项目是在 Angular 8 中构建的。为了响应 API,我实现了一个模拟服务器。我的 package.json 有以下脚本:

"scripts": {
"ng": "ng",
"mock": "node lib/stub-server",
"start": "concurrently --kill-others \"npm:mock\" \"ng serve\"",
"validate-pipeline-quality": "node validate-pipeline-quality.js",
"build": "ng build --prod --output-hashing=none && node build-element.js",
"test": "ng test --watch=false",
"lint": "ng lint",
"e2e": "concurrently --kill-others --success \"first\" \"ng e2e\" \"npm:mock\""

},

最近,我在运行 npm run e2e 时遇到了错误。以下是错误:

FVFXR3EBHV2H:communication-preference-public smukher$ npm run e2e

> communication-preference-public@1.1.0 e2e /Users/smukher/AEVA/Applications/Frontend/communication-preference-public
> concurrently --kill-others --success "first" "ng e2e" "npm:mock"

[mock] 
[mock] > communication-preference-public@1.1.0 mock /Users/smukher/AEVA/Applications/Frontend/communication-preference-public
[mock] > node lib/stub-server
[mock] 
[mock] /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/lib/stub-server/../../test/stub-server
[mock] Mock Server is listening at 8080
[0] [10:38:03] I/config_source - curl -o/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
[0] [10:38:06] I/update - chromedriver: file exists /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.16.zip
[0] [10:38:06] I/update - chromedriver: unzipping chromedriver_80.0.3987.16.zip
[0] [10:38:06] I/update - chromedriver: setting permissions to 0755 for /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.16
[0] [10:38:06] I/update - chromedriver: chromedriver_80.0.3987.16 up to date
[0] ℹ 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
[0] ℹ 「wds」: webpack output is served from /
[0] ℹ 「wds」: 404s will fallback to //index.html
[0] 
[0] chunk {main} main.js, main.js.map (main) 42.8 kB [initial] [rendered]
[0] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 268 kB [initial] [rendered]
[0] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
[0] chunk {scripts} scripts.js, scripts.js.map (scripts) 13.7 kB [entry] [rendered]
[0] chunk {styles} styles.js, styles.js.map (styles) 10.1 kB [initial] [rendered]
[0] chunk {vendor} vendor.js, vendor.js.map (vendor) 4.58 MB [initial] [rendered]
[0] Date: 2020-02-05T09:38:15.981Z - Hash: de103d383b4a486e03cd - Time: 7446ms
[0] ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
[0] ℹ 「wdm」: Compiled successfully.
[0] [10:38:16] I/launcher - Running 2 instances of WebDriver
[0] [10:38:17] I/testLogger - 
[0] ------------------------------------
[0] 
[0] [10:38:17] I/testLogger - [chrome #01] PID: 6939
[0] [chrome #01] Specs: /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/e2e/src/app.component.ispec.ts
[0] [chrome #01] 
[0] [chrome #01] [10:38:16] I/direct - Using ChromeDriver directly...
[0] [chrome #01] 
[0] [chrome #01] /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/error.js:546
[0] [chrome #01]         throw new ctor(message);
[0] [chrome #01]               ^
[0] [chrome #01] SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 80
[0] [chrome #01]   (Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Mac OS X 10.14.6 x86_64)
[0] [chrome #01]     at Object.checkLegacyResponse (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/error.js:546:15)
[0] [chrome #01]     at parseHttpResponse (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/http.js:509:13)
[0] [chrome #01]     at doSend.then.response (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/http.js:441:30)
[0] [chrome #01]     at process._tickCallback (internal/process/next_tick.js:68:7)
[0] [chrome #01] From: Task: WebDriver.createSession()
[0] [chrome #01]     at Function.createSession (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
[0] [chrome #01]     at Function.createSession (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/chrome.js:761:15)
[0] [chrome #01]     at Direct.getNewDriver (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/driverProviders/direct.js:77:33)
[0] [chrome #01]     at Runner.createBrowser (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/runner.js:195:43)
[0] [chrome #01]     at q.then.then (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/runner.js:339:29)
[0] [chrome #01]     at _fulfilled (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:834:54)
[0] [chrome #01]     at /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:863:30
[0] [chrome #01]     at Promise.promise.promiseDispatch (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:796:13)
[0] [chrome #01]     at /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:556:49
[0] [chrome #01]     at runSingle (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:137:13)
[0] 
[0] [10:38:17] I/testLogger - 
[0] 
[0] [10:38:17] E/launcher - Runner process exited unexpectedly with error code: 1
[0] [10:38:17] I/launcher - 1 instance(s) of WebDriver still running
[0] [10:38:17] I/testLogger - 
[0] ------------------------------------
[0] 
[0] [10:38:17] I/testLogger - [chrome #11] PID: 6940
[0] [chrome #11] Specs: /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/e2e/src/app.component.ispec.ts
[0] [chrome #11] 
[0] [chrome #11] [10:38:16] I/direct - Using ChromeDriver directly...
[0] [chrome #11] 
[0] [chrome #11] /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/error.js:546
[0] [chrome #11]         throw new ctor(message);
[0] [chrome #11]               ^
[0] [chrome #11] SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 80
[0] [chrome #11]   (Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Mac OS X 10.14.6 x86_64)
[0] [chrome #11]     at Object.checkLegacyResponse (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/error.js:546:15)
[0] [chrome #11]     at parseHttpResponse (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/http.js:509:13)
[0] [chrome #11]     at doSend.then.response (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/http.js:441:30)
[0] [chrome #11]     at process._tickCallback (internal/process/next_tick.js:68:7)
[0] [chrome #11] From: Task: WebDriver.createSession()
[0] [chrome #11]     at Function.createSession (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
[0] [chrome #11]     at Function.createSession (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/chrome.js:761:15)
[0] [chrome #11]     at Direct.getNewDriver (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/driverProviders/direct.js:77:33)
[0] [chrome #11]     at Runner.createBrowser (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/runner.js:195:43)
[0] [chrome #11]     at q.then.then (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/runner.js:339:29)
[0] [chrome #11]     at _fulfilled (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:834:54)
[0] [chrome #11]     at /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:863:30
[0] [chrome #11]     at Promise.promise.promiseDispatch (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:796:13)
[0] [chrome #11]     at /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:556:49
[0] [chrome #11]     at runSingle (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:137:13)
[0] 
[0] [10:38:17] I/testLogger - 
[0] 
[0] [10:38:17] E/launcher - Runner process exited unexpectedly with error code: 1
[0] [10:38:17] I/launcher - 0 instance(s) of WebDriver still running
[0] [10:38:17] I/launcher - chrome #01 failed with exit code: 1
[0] [10:38:17] I/launcher - chrome #11 failed with exit code: 1
[0] [10:38:17] I/launcher - overall: 2 process(es) failed to complete
[0] [10:38:17] E/launcher - Process exited with error code 100
[0] ng e2e exited with code 1
--> Sending SIGTERM to other processes..
[mock] npm run mock exited with code SIGTERM
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! communication-preference-public@1.1.0 e2e: `concurrently --kill-others --success "first" "ng e2e" "npm:mock"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the communication-preference-public@1.1.0 e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/smukher/.npm/_logs/2020-02-05T09_38_17_200Z-debug.log

我已经检查了 chromedriver 版本及其最新版本。 我已经检查了量角器中的 webdriver-manager 版本,那也是 12.1.7 我已经尝试了网上提到的所有技巧。但对我来说似乎没有任何帮助。

有人可以帮我吗?

谢谢

沙斯瓦塔·穆克吉

【问题讨论】:

  • 同样的错误,无法更新驱动程序到 79.0.3945.130...
  • 嗨,你是怎么解决这个问题的?

标签: protractor selenium-chromedriver angular8


【解决方案1】:

只需将您的 chrome 浏览器版本更新到 80 即可解决问题。

如果它不能解决问题,请发布您的配置详细信息。

【讨论】:

  • 修订 fcea73228632975e052eb90fcf6cd1752d3b42b4-refs/branch-heads/3987@{#974}。操作系统 macOS 版本 10.14.6(内部版本 18G3020)。 JavaScript V8 8.0.426.26。 Flash 32.0.0.330 /Users/***/Library/Application Support/Google/Chrome/PepperFlash/32.0.0.330/PepperFlashPlayer.plugin。用户代理 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36 Command Line /Applications/Google Chrome.app/Contents/MacOS/Google Chrome --flag -switches-begin --flag-switches-end --enable-audio-service-sandbox
  • Google Chrome 80.0.3987.132(官方版本)(64 位)。
  • “directConnect”的值是多少:,? @ShaswataMukherjee 请发布您的 conf.js 文件内容
猜你喜欢
  • 1970-01-01
  • 2021-07-29
  • 2019-05-16
  • 2021-01-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多