1

I am confused with the protractor versions and how exactly it works. so there are two different node projects which I have created, and I am using protractor versions "protractor": "~5.4.0" in both of my projects.

When I am trying to run command npm run e2e one project is installing chrome driver version 2.46

[15:12:36] I/downloader - curl -o/home/circleci/project/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.46.zip https://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip [15:12:36] I/update - chromedriver: unzipping chromedriver_2.46.zip [15:12:36] I/update - chromedriver: setting permissions to 0755 for /home/circleci/project/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.46 [15:12:36] I/launcher - Running 1 instances of WebDriver [15:12:36] I/direct - Using ChromeDriver directly...

{ "name": "solutions-web", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "build:prod": "ng build --prod --build-optimizer", "test": "ng test", "test:deployment": "ng test --watch=false --no-progress --code-coverage", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "~7.2.0", "@angular/common": "~7.2.0", "@angular/compiler": "7.2.0", "@angular/core": "~7.2.0", "@angular/forms": "~7.2.0", "@angular/http": "~7.2.0", "@angular/platform-browser": "~7.2.0", "@angular/platform-browser-dynamic": "~7.2.0", "@angular/router": "~7.2.0", "angular-web-storage": "^7.0.0-beta.1", "bluebird": "^3.5.5", "classlist.js": "^1.1.20150312", "core-js": "^2.6.2", }, "devDependencies": { "@angular-devkit/build-angular": "~0.12.0", "@angular/cli": "~7.2.0", "@angular/compiler-cli": "~7.2.0", "@angular/language-service": "~7.2.0", "@types/jasmine": "~3.3.5", "@types/jasminewd2": "~2.0.6", "@types/node": "~10.12.18", "codelyzer": "~4.5.0", "jasmine-core": "~3.3.0", "jasmine-data-provider": "~2.2.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~3.1.4", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.4", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", "lodash": "^4.17.11", "protractor": "~5.4.0", "tiny-date-picker": "^3.2.8", "ts-node": "~7.0.0", "tslint": "~5.12.0", "typescript": "~3.2.2" }

Another project is installing chrome driver version _75.0.3770.140

[14:40:30] I/config_source - curl -o/home/circleci/project/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/ [14:40:30] I/downloader - curl -o/home/circleci/project/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_75.0.3770.140.zip https://chromedriver.storage.googleapis.com/75.0.3770.90/chromedriver_linux64.zip [14:40:31] I/update - chromedriver: unzipping chromedriver_75.0.3770.140.zip [14:40:31] I/update - chromedriver: setting permissions to 0755 for /home/circleci/project/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_75.0.3770.140 [14:40:31] I/launcher - Running 1 instances of WebDriver [14:40:31] I/direct - Using ChromeDriver directly...

{ "name": "web-project", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "~7.1.0", "@angular/common": "~7.1.0", "@angular/compiler": "~7.1.0", "@angular/core": "~7.1.0", "@angular/forms": "~7.1.0", "@angular/platform-browser": "~7.1.0", "@angular/platform-browser-dynamic": "~7.1.0", "@angular/router": "~7.1.0", "core-js": "^2.5.4", "rxjs": "~6.3.3", "tslib": "^1.9.0", "zone.js": "~0.8.26" }, "devDependencies": { "@angular-devkit/build-angular": "~0.11.0", "@angular/cli": "~7.1.0", "@angular/compiler-cli": "~7.1.0", "@angular/language-service": "~7.1.0", "@types/node": "~8.9.4", "@types/jasmine": "~2.8.8", "@types/jasminewd2": "~2.0.3", "webpack-dev-server": ">=3.1.11", "codelyzer": "~4.5.0", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~3.1.1", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~1.1.2", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.12.0", "typescript": "~3.1.6" } }

how is this possible when I am giving the same protractor version? can someone help me to understand the process and help me to overcome this issue?

4

1 回答 1

0

旧版本的 webdriver-manager

这意味着您在第一个旧项目中有一个 webdriver-manager 节点模块。下载 chromedriver 2.46 不再适用于最新版本的 Chrome。

Protractor ~5.4.x package.json 依赖需要 webdriver-manager ^12.xx 这意味着它将下载任何次要版本更新。因此,对于测试的较新安装,您将下载较新版本的 webdriver-manager。这些更高版本对 Chrome 浏览器主要版本进行了修复。现在最新的应该是 ChromeDriver 的 76 版本。

尝试下载正确版本的 ChromeDriver

假设您仍然需要 chromedriver 2.46 版,因为您仍在运行 Chrome 73 版(我认为这是它支持的 Chrome 版本),那么您可以使用webdriver-manager update --versions.chrome 2.46. 同样,如果您需要版本 75,您可以从https://chromedriver.storage.googleapis.com下载特定版本。所以你可以运行webdriver-manager update --versions.chrome 75.0.3770.90,它会下载那个特定的版本。

这会好转吗?

是的。有一些修复,但当前的 webdriver-manager 版本 12 没有提供支持。 Protractor 6 很快就会采用一些重大更改......当它(最终)推出时。

于 2019-08-07T01:27:18.640 回答