Protractor issue while running the conf.js file for new chromedriver versions like 76.0.3809.68
I am trying to run the protractor tests on latest chrome version which got updated today 76.0.3809.100 but they keep failing and giving error. The versions that i have are protractor version: 5.4.2,
webdriver-version: 12.1.6,
selenium standalone version available: 3.141.59
chromedriver versions available: 2.46 [last], 76.0.3809.12
geckodriver version available: v0.24.0 [last]
I have tried updating the webdriver manager using webdriver-manager update to update the chrome driver, have also tried to reinstall the webdriver-manager and insatll a specific version of webdriver but nothing seems to be working. I also tried to install a lower version of chrome i.e 75 but everytime i try it installs the latest version instead. The tests were running fine before just after the update they stopped working.
Any help / suggestion regarding this issue would be really helpful.
This is the error being thrown:
E/launcher - session not created: Chrome version must be between 71 and 75
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.17763 x86_64)
[15:08:03] E/launcher - SessionNotCreatedError: session not created: Chrome version must be between 71
and 75
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.17763 x86_64)
at Object.checkLegacyResponse (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebDriver.createSession()
at Function.createSession (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
at Function.createSession (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:761:15)
at Direct.getNewDriver (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\built\driverProviders\direct.js:77:33)
at Runner.createBrowser (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\built\runner.js:195:43)
at q.then.then (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\built\runner.js:339:29)
at _fulfilled (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30
at Promise.promise.promiseDispatch (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (C:\Users\gmangat\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13)
[15:08:03] E/launcher - Process exited with error code 199
This is my conf.js file exports.config = {
directConnect: true,
multiCapabilities: [{
browserName: 'chrome',
acceptInsecureCerts: true,
'specs': [
//e2e Specs
'./src/e2e/shared/specs/LoginTest.e2e.spec.js',
'./src/api/unified-message-api/specs/createUMTask.js',
],
chromeOptions: {
args: ['--disable-infobars', '--disable-browser-side-navigation'],
prefs: {
'profile.managed_default_content_settings.notifications': 1
}
},
}],
framework: 'jasmine2',
SELENIUM_PROMISE_MANAGER: true,
onPrepare: function () {
browser.ignoreSynchronization = true;
browser.driver.manage().timeouts().implicitlyWait(5000);
browser.driver.manage().window().setSize(1280, 1024);
//npm install jasmine-spec-reporter --save-dev
var specReporter = require('jasmine-spec-reporter').SpecReporter;
jasmine.getEnv().addReporter(new specReporter({
displayFailuresSummary: true,
displayFailuredSpec: true,
displaySuiteNumber: true,
displaySpecDuration: true
}));
var AllureReporter = require('jasmine-allure-reporter');
jasmine.getEnv().addReporter(new AllureReporter({
resultsDir: 'allure-results'
}));
jasmine.getEnv().afterEach(function (done) {
browser.takeScreenshot().then(function (png) {
allure.createAttachment('Screenshot', function () {
return new Buffer(png, 'base64')
}, 'image/png')();
done();
})
});
},
jasmineNodeOpts: {
defaultTimeInterval: 6000000
}
};
/* Version Used:
Node: 10.15.3
Protractor : 5.4.2
npm i protractor#5.4.2
*/
The solution that worked for me was navigating to ./node_modules/protractor and running npm i webdriver-manager#latest.
Then go back to the app root and run webdriver-manager update and this time it should download the v76 driver.
You need to install compatible chromedriver version which is 76.0.0. chromedriver versioning convention is now changed to track the chrome version.
I was also facing same issue, here is a workaround which I tried and it helped me:
I did a fresh install of Node, npm, Protractor - All latest versions
I did npm install -g protractor and webdriver-manager update which downloaded chromedriver_76.0.3809.12.zip and geckodriver_v0.24.0
Also I am using few npm modules in my test which I install locally by npm install command under ~\<Project Folder>\Test\npm_modules
I replaced content of selenium folder from C:\Users\<username>\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\selenium\ to ~\<Project Folder>\Test\npm_modules\Protractor\node_modules\webdriver-manager\selenium\
and this fixed the above mentioned error.
Related
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'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
I am new to using Protractor. I ran the sample Protractor code- Chrome is invoked but hangs and E/launcher Process exited with error code 199.
These are the tools and versions I have installed.
npm - 6.4.1
Protractor - 5.4.1
Webdriver -12.1.0
chromedriver 2.42
selenium server standalone -3.14.0
I have also installed the latest JDK and JRE files.
Spec.js file:
describe('Protractor Demo App', function() {
it('should have a title', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
expect(browser.getTitle()).toEqual('Super Calculator');
});
})
Conf.js file
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['spec.js'],
framework: 'jasmine',
};
I tried options like Direcconnect: true and useAllAngular2AppRoots: true, but the hanging problem doesn't stop. Any help will be appreciated.
Some time ago google announced that headless chrome is available in newest chrome versions.
Over there we can find config for headless chrome with protractor.
When I'm trying to run my test suite with directConnect - everything works as a charm.
capabilities looks like that:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--start-maximized']
}
},
When I change args line to:
args: ['--start-maximized', '--headless', '--disable-gpu']
and run tests, I receive an error:
E/protractor - Could not find Angular on page https://address.com/ : retries looking for angular exceeded
Unhandled rejection Error: Angular could not be found on the page https://address.com/.If this is not an Angular application, you may need to turn off waiting for Angular.
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
at executeAsyncScript_.then (/home/user/Projects/pef/tests/e2e/node_modules/protractor/lib/browser.ts:936:29)
at ManagedPromise.invokeCallback_ (/home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:1366:14)
at TaskQueue.execute_ (/home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:2970:14)
at TaskQueue.executeNext_ (/home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:2953:27)
at asyncRun (/home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:2813:27)
at /home/user/Projects/pef/tests/e2e/node_modules/selenium-webdriver/lib/promise.js:676:7
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Have anyone faced with this issue?
node: v8.4.0
npm: 5.3.0
chrome: 60.0.3112.113
protractor: 5.1.2