Reputation: 1
I'm trying to launch the browser through Protractor. I downloaded webdriver through terminal by giving webdriver-manager update
command. This is downloading the latest chromedriver v74, but the chrome browser is v73.
How to explicitly set the WebDriver version?
I'm getting the following error:
[11:09:13] E/driverProvider - Error code: 135
[11:09:13] E/driverProvider - Error message: session not created: This version of ChromeDriver only supports Chrome version 74
[11:09:13] E/driverProvider - Error: session not created: This version of ChromeDriver only supports Chrome version 74
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.70 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'Acsahs-MBP', ip: 'fe80:0:0:0:45:3f89:2e8b:ab96%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.2', java.version: '1.8.0_191'
Driver info: driver.version: unknown
at Local.<anonymous> (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:69:23)
at Generator.throw (<anonymous>)
at rejected (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:5:65)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
[11:09:13] E/launcher - Process exited with error code 135
My config file:
exports.config = {
seleniumaddress:'http://localhost:4444/wd/hub',
specs:['spec.js']
};
Upvotes: 0
Views: 1504
Reputation: 2402
Add this as a script to your package.json file
"scripts": {
"protactorInstall": "cd ./node_modules/protractor && npm i webdriver-manager@latest"}
use
npm run protactorInstall
to execute the script.
Upvotes: 1
Reputation: 191
is it solved yet? if not then try this.
for my small selenium-webdriver
test i did these steps after i researched online and here:
npm install selenium-webdriver
npm install chromedriver
npm install geckodriver
and opened file library.js and npm init
and ran node library.js
(source code below)Error:
(node:14212) UnhandledPromiseRejectionWarning: NoSuchSessionError: invalid session id
Some long error related to not same chromedriver version. so i checked the chrome browser version manually in the browser. it was version 73
and my mistake i had downloaded chromedriver version 74.0
.https://chromedriver.storage.googleapis.com/index.html?path=73.0.3683.68/
download according to your OS and download it in ~/Downloads
.terminal
in the ~/Downloads
folder.USER@DESKTOP:~/Downloads$ unzip ~/Downloads/chromedriver_linux64.zip -d ~/Downloads
You will get the raw chromedriver
file in ~/Downloads
folder.ChromeDriver 73.0.3683.68
file to two places - usr/local/bin
and usr/bin
in my system. chromedriver
file in usr/local/bin
.to move the file - USER@DESKTOP:~/Downloads$ sudo mv -f ~/Downloads/chromedriver /usr/local/bin/chromedriver
and USER@DESKTOP:~/Downloads$ sudo mv -f ~/Downloads/chromedriver /usr/bin/chromedriver
you are saying you want to move the file chromedriver from first location to other means replacing any files already in those locations with same name.
Last all i did was. close the vscode and relaunched it. and ran my code node library.js
. and it worked it the chrome browser for me.
TOOK AN HOUR FOR ME TO GO THROUGH AROUND 35-40 STACK-OVERFLOW AND RANDOM ONLINE RESOURCES/QUESTION-ANSWERS BUT WAS WORTH IT. :)
SOURCE CODE : LIBRARY.JS
var webdriver = require('selenium-webdriver');
var By = webdriver.By;
var until = webdriver.until;
var driver = new webdriver.Builder().forBrowser('chrome').build();
driver.get('https://www.google.com');
Upvotes: 1
Reputation: 1442
Try the below command from terminal to install particular version
webdriver-manager update --versions.chrome 2.46
Hope it helps you
Upvotes: 0