How to get rid off older chromedriver version - selenium-webdriver

I was using chromedriver ver. 75.0.3770.8 however Chrome browser was updated by then and now I need to install chromedriver a least 77.0. I did so, I exchange chromedriver.exe file in the folder where the previous but it didn't work, Still there was error code 199 -> that available verison of chromedriver is 75. Then I used webdriver-manager update --versions.chrome 77.0.3865.40 and wbedriver-status command says that I have twoe versions of chromedriver:
I/status - chromedriver versions available: 76.0.3809.12, 77.0.3865.40 [last]
But when I attempt to run test it only seems to see 75 verison and error 199 still occurs. I've added Path Env. Variable as on this video:
https://youtu.be/dz59GsdvUF8?t=51
Any ideas how to remove the older verison 75?

protractor can be download/setup as global and local as per your npm command.
Check if your deleting from local and script pointing to global npm package of protractor or vice versa

Related

Invalid or corrupt jar file when trying to start selenium server from intelliJ

I am trying to start my selenium server from intelliJ and it is saying the file is corrupt.
I use intelliJ to run my protractor tests, and when I starts the selenium server from the intelliJ terminal before I run them. For whatever reason it is saying my jar file for selenium-server-standalone is coming back as corrupt. Is there a way to fix this and, if not, is there a way to delete and then reinstall selenium server?
C:\Users\pheonix.jones\IdeaProjects\attensity-q-protractor>webdriver-manager
start [11:39:09] I/start - java
-Dwebdriver.chrome.driver=C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.46.exe
-Dwebdriver.gecko.driver=C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\pro
tractor\node_modules\webdriver-manager\selenium\geckodriver-v0.24.0.exe
-jar C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-4.0.0-alpha-1.zip.jar
-port 4444 [11:39:09] I/start - seleniumProcess.pid: 2748 Error: Invalid or corrupt jarfile
C:\Users\pheonix.jones\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-4.0.0-alpha-1.zip.jar
[11:39:09] I/start - Selenium Standalone has exited with code 1
As you can see, it is just exiting after it comes back as corrupt. I haven't had issues with this before. I did try to update the webdriver.
I found a workaround, which may or may not be acceptable. You can force webdriver-manager to use an older version of the selenium-standalone package. This avoids whatever the problem is with 4.0.0-alpha-1.
$ webdriver-manager clean
$ webdriver-manager update --standalone --versions.standalone=3.8.0
$ webdriver-manager start --versions.standalone=3.8.0
…
[14:19:55] I/start - seleniumProcess.pid: 63863
14:19:55.379 INFO - Selenium build info: version: '3.8.0', revision: '924c4067df'
14:19:55.380 INFO - Launching a standalone Selenium Server
2019-04-24 14:19:55.483:INFO::main: Logging initialized #390ms to org.seleniumhq.jetty9.util.log.StdErrLog
There is an open defect in the webdriver-manager project for this issue: https://github.com/angular/webdriver-manager/issues/370
As a temporary workaround you can use the directConnect attribute in your protractor config.
There is issue with 4.0.0-alpha-1 , after deleting files you can install some older versions that will work. If you will just update wevdriver manager by using webdriver-manager update then it will not work for you but you need to use something like " webdriver-manager update --standalone --versions.standalone="some older version"
Since you are using Protractor, you can try a webdriver-manager update
You should be starting the server like this - webdriver-manager start
I believe Protractor's webdriver-manager already contains the selenium standalone server.
Or you can just add this line in your conf file, and you will no longer need to manually start anything before running a Protractor spec file directConnect: true

Unable to start webdriver-manager on mac to test angular apps on protractor

I am new to protractor. While starting the Selenium Server using webdriver-manager in protractor I am getting the following error
[19:32:29] I/start - java Dwebdriver.chrome.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.31 -Dwebdriver.gecko.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.18.0 -jar /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.0.jar -port 4444
[19:32:29] I/start - seleniumProcess.pid: 823 Error: Unable to access jarfile /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.0.jar
[19:32:29] I/start - Selenium Standalone has exited with code 1
AgIwals-MacBook-Pro:angulartestingprotractor agiwal$ Error: Unable to access jarfile /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.0.jar
My protractor version is 5.1.2 and my npm version is 3.10.10. Can somebody help me with this error?
Looks like you need to update webdriver-manager - a new version was released yesterday so your timing is coincidental. You can also see the language bindings release dates here: http://docs.seleniumhq.org/download/. And since you mentioned you're on Protractor v5+, you should also confirm that your node (not npm) version is v6+.
You simply need to run webdriver-manager update -- personally I like to avoid potential driver/version conflicts by cleaning out any old downloads via webdriver-manager clean, but that's up to you (run the update after clean).

Protractor / Selenium Webdriver : Runtime.executionContextCreated has invalid 'context'

I use protractor to test Angular2 app. It was working fine and I think I didn't change nothing in conf but now it ends up with this:
...
super(opt_error);
^
SessionNotCreatedError: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"4012.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.21.371459
...
I work on a Mac OSX 10.11.4, Chrome 54.0.2840.71.
Any suggestion? Thanks
--- EDIT 26/10
Since it depends on each one settings it looks like theres no absolute answer to this. The main idea is to update protractor/ chromedriver / webdriver-manager accordingly.
Saying that i now face another problem : every basic test i do, including ( for instance ) a browser.get() is failing with :
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL
I don't know if it's an isolated case and if it fits here (I use jasmine2 as framework) so I start another question here
I installed ChromeDriver v2.24 and stored it in: /usr/local/Cellar/chromedriver/2.24/bin and it fixed the error for me.
As mentioned by others, looks like it is a problem with the chromedriver installed in the system with the new version of chrome. For mac, I updated the chromedriver using 'chromedriver-update' and this fixed it.
I had a similar problem and solver it by forcing chromedriver 2.24 to install by manually removing webdriver-manager
delete the folder rm -rf /usr/local/lib/node_modules/webdriver-manager/
reinstall webdriver
npm install -g webdriver-manager
I updated the selenium-standalone to the latest version 5.8.0 (from 5.1.0). It will install the newer version of chrome webdriver(2.25), instead of install chrome driver2.21. This solved the issue on my end.(no connection, session exception)
If even after updating the webdriver to 2.25, the error is still occurring and if you are using the terminal app this should help :
I managed to fix the issue by unchecking “Set locale environment variables on startup” checkbox in advanced terminal app settings.
Or try to launch your test with this prefix :
LC_NUMERIC=”en_US.UTF-8″ npm test

"Runtime.executionContextCreated has invalid 'context" error when i run Protractor

I am getting this below Error while i run my protractor. And below is the error as shown in my webstorm console.
"C:\Program Files (x86)\JetBrains\WebStorm 2016.2\bin\runnerw.exe"
"C:\Program Files\nodejs\node.exe"
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\cli.js
C:\Users\x216526\workspace_Protractor\SWA_Protractor\conf.js
[17:59:58] I/direct - Using ChromeDriver directly... [17:59:58]
I/launcher - Running 1 instances of WebDriver [18:00:01] E/launcher -
session not created exception from unknown error:
Runtime.executionContextCreated has invalid 'context':
{"auxData":{"frameId":"9784.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2824.0) (Driver info:
chromedriver=2.22.397933
(1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT
6.1.7601 SP1 x86_64) [18:00:01] E/launcher - SessionNotCreatedError: session not created exception from unknown error:
Runtime.executionContextCreated has invalid 'context':
{"auxData":{"frameId":"9784.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2824.0) (Driver info:
chromedriver=2.22.397933
(1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT
6.1.7601 SP1 x86_64) at WebDriverError (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:26:26)
at SessionNotCreatedError
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:307:26)
at Object.checkLegacyResponse
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:639:15)
at parseHttpResponse
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:538:13)
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:472:11
at ManagedPromise.invokeCallback_
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1379:14)
at TaskQueue.execute_
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2913:14)
at TaskQueue.executeNext_
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2896:21)
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2820:25
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7
From: Task: WebDriver.createSession() at Function.createSession
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:329:24)
at Driver
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:778:38)
at Direct.getNewDriver
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\driverProviders\direct.js:68:26)
at Runner.createBrowser
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\runner.js:187:43)
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\runner.js:261:30
at _fulfilled
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13)
[18:00:01] E/launcher - "process.on('uncaughtException'" error, see
launcher [18:00:01] E/launcher - Process exited with error code 199
Process finished with exit code 199
My config js look like below:
exports.config = {
directConnect: true, // Capabilities to be passed
//to the webdriver instance.
capabilities: { 'browserName': 'chrome', },
framework: 'jasmine2',
specs: ['./src/sli_sanitytests/San1_Check_
Sli_Homepage_is_Accessible_spec.js',
'./src/sli_sanitytests/San2_
Click_createButton_to_Open_Sli_CreateForm_page_spec.js',
'./src/sli_sanitytests/San3_
Create_Sli_reference_spec.js' ],
suites: {
smoke: ['./smoke/!*.spec.js'],
regression:['./regression/!*.spec.js'],
functional: ['./functional/!*.spec.js'],
all: ['./!*!/!*.spec.js'],
selected:['./functional/addcustomer.spec.js',
'./regression/openaccount.spec.js'],
},
// Options to be passed to Jasmine
jasmineNodeOpts: {
//onComplete will be called just before the driver quits.
onComplete: null,
// If true, display spec names.
isVerbose: true, // If true,print colors to the terminal.
showColors: true, // If true, include stack traces in
//failures.
includeStackTrace: true, // Default time to wait in ms
//before a test fails.
defaultTimeoutInterval: 80000
},
//enter code here
onPrepare:function() {
browser.ignoreSynchronization = true;
browser.driver.manage().window().maximize();
},
}
2016-10-13: ChromeDriver v2.24 has been released which supports Chrome v52-54. (Thanks #Anton)
2016-08-16: One of the recent updates to the Chrome Dev channel introduced a bug preventing ChromeDriver from properly starting. Having just worked around the same problem, I would suggest backing up your data and reverting to the Beta or Stable release channel of Chrome. See the Chrome Release Channels for more details on safely switching.
Alternatively, switching to the Dev version of ChromeDriver should also fix the issue. From a closed issue on the chromedriver project:
There are some Devtool changes in Chrome dev channel v54 which is not currently supported in Chromedriver stable v2.23.
You may want to use dev version of Chromedriver which has the fix. It can be downloaded from chromedriver…/continuous/….zip
Review the issue for the full link.
If the latest protractor is not having the latest chromedriver then to update it using webdriver-manager follow these below steps
enter latest chromedriver version in file config.json this file is present under path /node_modules/protractor/node_modules/webdriver-manager/built
optional (and change 'mac32' to 'mac64' in file 'chrome_driver.js' which is present under path /webdriver-manager/built/lib/binaries)
run webdriver-manager update in the console.
hint: To get the path of 'webdriver-manager' folder observe the console after command webdriver-manager update
Since I got the same issue and found this question, I'd like to add a bit more context: it is indeed a version problem between an 'old' chrome driver (2.22 in my case) and a 'newer' chrome release (54 in my case) like Sean answered.
However there is no need to fiddle manually with config files or downloads.
Instead just run
npm update protractor -g
To update protractor globally then
webdriver-manager update
To update the chrome driver. The newer chrome driver v2.25 is not yet included in the protractor package at the time of writing (you will get v2.24 instead) but it works fine with Chrome 54. Protractor is v4.09 at the time of writing. The same trick should work for future versions too!
After big battle with above issue i have found the solution for it. So please
don`t do anything.
First of all uninstall your chrome browser and reinstall it. That`s it protractor will not throw any such errors.
I even don`t know why this happened and for what reasons looks bit strange but yes the only solution is uninstall the chrome browser and reinstall it.
npm uninstall webdriver-manager -g
npm install webdriver-manager -g
I have the same problem with 2.24 version. In order to fix this bug download chromedriver.exe with version 2.25, it's available now by link https://sites.google.com/a/chromium.org/chromedriver/downloads
Try to reinstall webdriver-manager
npm uninstall webdriver-manager -g
npm install webdriver-manager -g
Issue was fixed for me after I installed webdriver-manager: 10.2.8
This is common issue, I faced it many times.
I use chromedriver in my selenium framework once in month and I usually get this type of error.
Follow below steps:
Unistall/Remove all existing chromedriver.
Install latest
chromedriver from official google site.
Set system path to chromedriver.exe folder (So you don't need to bother about setting the system path from code)
Restart the IDE (If already running)
ENJOY !
I updated to Chrome Driver 2.25 which fixed the problem for me. This is a simple update:
Download the latest version from: https://sites.google.com/a/chromium.org/chromedriver/downloads
Unzip the contents (it's one file "chromedriver.exe").
Copy that over your existing chromedriver.exe
For me that was at: \node_modules\protractor\selenium
That's it. I reran the tests and the pesky error went away.
First of all uninstall your chrome browser and reinstall it. That`s it protractor will not throw any such errors.
I even don`t know why this happened and for what reasons looks bit strange but yes the only solution is uninstall the chrome browser and reinstall it.
npm uninstall webdriver-manager -g npm install webdriver-manager -g

How do I confirm I'm using the right chromedriver?

I came in to the office yesterday morning to find that my Capybara tests couldn't interact with Chrome. I'm seeing
Selenium::WebDriver::Error::UnknownError: unknown error: unable to discover open pages
Googling around revealed that this was likely caused by an out-of-date chromedriver or selenium-webdriver, which sounded very plausible, since neither had been updated in a long time (I think chromedriver was at 2.2 and selenium-webdriver was at 2.35.1), and since Chrome auto-updated to 32.0.1700.77 on January 14, that seemed like good solid evidence to me.
So I've updated selenium-webdriver to 2.39.0. Figuring out what version of chromedriver I had been using actually turned out to be more difficult. I had a version of chromedriver sitting in my Downloads directory that I thought my code was referring to, but I couldn't find my Downloads directory in the PATH (I'm using OS X by the way). I tried replacing this file with version 2.8 from here, but it had no effect. I became skeptical that the version in my Downloads directory was the version that was being used in the first place, so I used brew to install it. brew info chromedriver now yields:
chromedriver: stable 2.8
http://code.google.com/p/chromedriver/
/usr/local/Cellar/chromedriver/2.8 (2 files, 21M) *
Built from source
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/chromedriver.rb
Looks good. My PATH contains /usr/local/bin, which has a chromedriver link to the location brew installed to. As far as I understand it, this should allow my automation to detect and launch the chromedriver.
Unfortunately, my issue is still unresolved. I remain unable to discover pages. Can anyone confirm that I've done what one normally does to set up the chromedriver?
Side Question: After downloading chromedriver 2.8 directly and also installing it with brew, I tried launching both the downloaded version and the brew version separately to confirm that either version could launch successfully. I'm certain they are both in fact version 2.8, but when I launch either one the console says:
Starting ChromeDriver (v2.2) on port 9515
Is that normal? I certainly wasn't expecting it to say v2.2, but there are no other versions apart from 2.8 installed by brew (so I doubt brew is accidentally using the older version), and when I run the file I downloaded directly, I'm quite sure it's version 2.8 from the Chromedriver website. Is this an oversight on their part, or does v2.2 refer to something else, unlikely though that may seem?
It would be tricky to verify the chrome driver version frequently when you download it with homebrew. I would suggest downloading the driver and maintaining it in a folder mapped in your PATH.
So that maintaining or identifying the driver version will be easy with the below steps:
Go to the folder where you have chromeDriver
Open command prompt pointing the folder
run: chromeDriver -v
ChromeDriver is at version 2.16 now. I would recommend manually updating your driver instead of updating with whatever older version that homebrew wants to update you to.
You can use command line: pip freeze to list down all packages you have installed with their version.
Or you also can use pip show <package name> to check the details of the package, which also includes package version.
Click here
chrome driver version
for checking your chrome driver version.
Now it's time to check the latest release version. So click here latest release version
Compare between;

Resources