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']
};
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.
so go to https://chromedriver.storage.googleapis.com/index.html?path=73.0.3683.68/ download according to your OS and download it in ~/Downloads .
then in open terminal in the ~/Downloads folder.
then USER#DESKTOP:~/Downloads$ unzip ~/Downloads/chromedriver_linux64.zip -d ~/Downloads You will get the raw chromedriver file in ~/Downloads folder.
now i moved the ChromeDriver 73.0.3683.68 file to two places - usr/local/bin and usr/bin in my system.
there was already a 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');
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.
Try the below command from terminal to install particular version
webdriver-manager update --versions.chrome 2.46
Hope it helps you
Related
I have the following piece of line in my package.json -
"webdriver-manager": "^12.1.7",
And when my protractor code runs in jenkins pipeline it throws me an error -
[01:11:30] I/testLogger - [chrome #01-12] PID: 12008
[chrome #01-12] Specs: C:\coco-e2e-5-2-2021\coco-web-client\apps\coco-e2e\outputFiles\JSFiles\view-comms-docs-tbs\view-comms.spec.js
[chrome #01-12]
[chrome #01-12] [01:11:29] I/direct - Using ChromeDriver directly...
[chrome #01-12] [01:11:30] E/runner - Unable to start a WebDriver session.
[chrome #01-12] [01:11:30] I/runnerCli - session not created: This version of ChromeDriver only supports Chrome version 90
[chrome #01-12] Current browser version is 89.0.4389.128 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[chrome #01-12] (Driver info: chromedriver=90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430#{#429}),platform=Windows NT 10.0.18363 x86_64)
What I see from Chrome driver's official release is, the latest chromedriver version is 90.0.4430.24.
But the latest chrome version for windows is 89.0.4389.128. And this is what causing the mismatch.
There's a chrome version 90.0.4430.66 released on 14th April, 2021 but that's compatible with Android chrome and not with windows chrome.
Now how do I tweak my code so that it will not take the chromerdriver v89.0.4389.23 instead of v90.0.4430.24?
The protractor test will not run locally but on a different system via jenkins. So updating chromedriver locally may solve my problem for debugging but not for running the test in the pipeline.
Any leads are very much appreciated. Thanks in advance.
what you actually need to do is to match a version of your local chrome to the version of chromedriver (the driver is the layer that controls your browser, so it's important to make them correspond to each other). So
First, find out what your version of chrome is. For example, it is 86.0.4240.111
Then, find out what chromedriver version can be used. Take the major version of the browser (first 3 numbers, 86.0.4240 in this case) and find the corresponding version of the driver by going to this url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION} (put the major browser version instead of ${CHROME_VERSION}). You'll see the chromedriver you're looking for is 86.0.4240.22
This is where the trickiest part begins. There are 2 installation of protractor usually:
local
global
I won't go over how to find which one you use, you can look it up. But when you find it, make sure you're updating the right one
When you know which protractor you're updating, go to it's folder and from that folder run npm i webdriver-manager#latest and then node ./bin/webdriver-manager update --gecko=false
when you updated the right webdriver, install the right chromedriver like so
node ./bin/webdriver-manager update --gecko=false --versions.chrome $VERSION
Make sure to put 86.0.4240.22 instead of $VERSION
Currently i am working protractor UI testing. My testcase is working properly so far, but suddenly it shows a webdriver problem. My current chrome version is 84. But the selenium driver is expecting version 85. Version 85 is still not released.
[14:56:46] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 85
(Driver info: chromedriver=85.0.4183.38 (9047dbc2c693f044042bbec5c91401c708c7c26a-refs/branch-heads/4183#{#779}),platform=Windows NT 10.0.17134 x86_64)
[14:56:46] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 85
(Driver info: chromedriver=85.0.4183.38 (9047dbc2c693f044042bbec5c91401c708c7c26a-refs/branch-heads/4183#{#779}),platform=Windows NT 10.0.17134 x86_64)
Either use webdriver-manager to specify your chromedriver version or use --webdriverUpdate=false if running e2e tests
(see: https://github.com/angular/protractor/issues/5460)
There seems to be an issue where webdriver-manager is installing ChromeDriver 85 even though Chrome 84 is the current stable release. Multiple people have reported this issue.
I've posted a workaround in issue 376
Overall, you temporarily can hardcode the version you want when using webdriver-manager, then tell protractor which version to use (since protractor can still try to install 85 and use it).
Here is the copied work-around:
We have webdriver-manager installed as project dependency (npm install --save-dev webdriver-manager)
we call webdriver-manager update --versions.chrome 84.0.4147.30 prior to running our tests. This will install the 84 chromedriver version in ./node_modules/webdriver-manager/selenium/. (We just made this as a npm script in our package.json)
We then update the protractor.conf file to have this line in the root of exports.config: chromeDriver:"./node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30.exe"**
Protractor still installs chromedriverr 85, but it will use the 84 version.
** In our case, we run our protractor tests in docker, but develop mostly on windows. So I updated the protractor.conf to have this line so that it works in either:
chromeDriver: process.platform === "win32" ? "./node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30.exe" : "./node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30"
I have had the same issue but it worked when I updated latest version of protractor which is 7.0.0
I'm trying to setup protractor on different computer. It is using the same files with my other computer (cannot be used because hdisc corrupted).
It run fine on my other computer but I am getting error "Process exited with error code 100" when I tried to run protractor on this one.
I've tried to delete the node modules, clean cache and perform npm install again to install the dependencies. It helps my earlier issue (cannot run webdriver) but is now causing me this one.
[14:44:09] I/launcher - Running 1 instances of WebDriver
[14:44:09] I/local - Starting selenium standalone server...
[14:44:11] E/launcher - Error: Error: Server terminated early with status 1
at earlyTermination.catch.e (C:\Users\PMO\Documents\DG\Jasmine\node_modules\selenium-webdriver\remote\index.js:252:52)
at process._tickCallback (internal/process/next_tick.js:68:7)
[14:44:11] E/launcher - Process exited with error code 100
npm ERR! code ELIFECYCLE
npm ERR! errno 100
npm ERR! ProtractorTutorial# protractor: `protractor conf.js`
npm ERR! Exit status 100
npm ERR!
npm ERR! Failed at the protractor# protractor script.
My current chrome version is: 74.0.3729.131
Webdriver version: chromedriver_74.0.3729.6.exe
OS: Windows 10.
Please advise me on how to fix this issue. Or is there any specific version of chrome and webdriver that can work?
use directConnect=true in your config. if you are already using that, The problem is with the webdriver.
Try running below commands from your project location
webdriver-manager clean
node node_modules/protractor/bin/webdriver-manager update --standalone --versions.standalone=3.8.0
I encountered a similar issue yesterday and inspired by Madhan's solution I worked it out.
I'm learning angularJS thru the official tutorial. I found protractor is actually a standalone tool (I'm a newbie in front-end development), which means it can be run separately.
So following the official setup guide, I run
protractor e2e-tests/protractor.conf.js
and found below feedback:
E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 77
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'xxx', ip: 'xxx', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '11.0.2'
Driver info: driver.version: unknown
remote stacktrace: 0 chromedriver_77.0.3865.40 0x00000001078b7f09 chromedriver_77.0.3865.40 + 3694345
And my chrome version was 76 in the moment.
So after I upgraded chrome to 77, it worked.
Tips:
if use directConnect=true in your config still doesn't work, try to run in standalone mode, which can provide you more useful feedback.
For me, the issue was a space after Scenario in the feature file
Wrong Scenario :
Corrected to Scenario: and the feature started executing
Cant see this answer above, so this might help someone
Your problem might be that you need to run your tests without sudo!
Sometimes if you get an EACCESS error, you can then change directory permissions so that you can run it without sudo.
My issue here was an outdated version of webdriver-manager. This fix only partially fixes the issue because it does not update the npm package. To completely fix this you need to ensure your package.json is configured with the correct webdriver-manager version (npm install webdriver-manager#latest --save-dev). Then you'll need to run:
npm install
node ./node_modules/protractor/bin/webdriver-manager clean
node ./node_modules/protractor/bin/webdriver-manager update
You may also need to run a npm dedupe to ensure all items are using the new package
In my case I had to run update + start
node node_modules/protractor/bin/webdriver-manager update --standalone --versions.standalone=3.8.0
node node_modules/protractor/bin/webdriver-manager start --standalone --versions.standalone=3.8.0
thank you 🤘🏻
For me it was a missing tsconfig.json file in my e2e folder. If you don't have one in your e2e folder, simply create one and put this code into it. Then run ng e2e again.
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
I'm using:
Angular CLI: 9.0.7
Node: 14.16.0
Chrome: 89.0.4389.82
chromedriver_89.0.4389.23
I used to run my protractor tests using directConnect: true option set.
The chromedriver I had at that time was chromedriver2.46
Now with the latest webdriver-manaegr12.1.4, the chromedriver was upgraded to ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729#{#29})
If I still continue to use directConnect: true and run my tests, I get the following error
session not created: This version of ChromeDriver only supports Chrome version 75
(Driver info: chromedriver=75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770#{#40}),platform=Mac OS X 10.14.4 x86_64)
Here is my very simple example: https://github.com/cnishina/protractor542-chrome74 It does not use a Docker container but it works for Chrome 74 with ChromeDriver 74.
Chrome browser + ChromeDriver versions
The output error message looks like session was not created because you are trying to use ChromeDriver 75. I would refer to http://chromedriver.chromium.org/downloads to match the ChromeDriver version to the Chrome browser version. The latest Chrome browser version is 74 so ChromeDriver downloads 74.0.3729.131. If you are still on Chrome browser 71-73, you could use ChromeDriver 2.46. Moving forward, the browser major version and chromedriver version must match. So for Chrome 73, you could use 73.0.3683.68.
Downloading different versions of ChromeDriver
If you need to download a different version of ChromeDriver, you could run the webdriver-manager command: webdriver-manager update --versions.chrome 73.0.3683.68 or to download 2.46, webdriver-manager update --versions.chrome 2.46.
I am using mac OSX El Capitan. I have installed eclipse Neon in it. I have a full setup of running selenium scripts using appium on real ios device. For this i have "ideviceinstaller" also installed. I created a project in a workspace to launch an app on the device and it is working fine. But when i copied the same code to different project, it starts giving me the error
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not initialize ideviceinstaller; make sure it is installed and works on your system) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 33.97 seconds
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42'
System info: host: 'MacBookBL9138C.local', ip: '10.104.150.28', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_73'.
I tried by uninstalling the current eclipse and installing eclipse lunar, but its still failing. I tried running same code in new workspace, but still same error.
Any help will be appreciated.
I think i have found the answer for this one. I missed to configure the path in eclipse.
For refer the below link for answer:
https://discuss.appium.io/t/error-could-not-initialize-ideviceinstaller-make-sure-it-is-installed-and-works-on-your-system/11699/5?u=tuhuynh