I have some problem with upgrading my chrome driver - javascript

I have console error after starting js selenium test:
DevTools listening on ws://127.0.0.1:51114/devtools/browser/ca96d3a3-e745-460c-9029-6102f08b81d9
(node:2632) UnhandledPromiseRejectionWarning: SessionNotCreatedError: session not created: This
version of ChromeDriver only supports Chrome version 80
There is error of incorrect selenium version and chrome driver. I have Chrome 83 version and I want to update chrome driver.
I input 'npm update', 'npm install', but error is present. The chrome driver isn't upgraded using this way. All links from browser search link me to the
https://sites.google.com/a/chromium.org/chromedriver/downloads
I downloaded this archive for windows 10, but it is console launcher to use chrome driver separate. It isn't update chrome driver in the node modules.
How can I upgrade my chrome driver?

https://chromedriver.chromium.org/downloads
Use latest chrome driver version and set path correctly

Related

No browser option displayed to select in Cypress tool dropdown even if the browsers are installed in local machine

I have installed Cypress version: 9.1.0, and I see only ELectron Browser as the default browser in the tool.
I have Google Chrome version 96.0 and Firefox installed in my local system but Cypress is unable to detect it. As I need to run the test on cross-browser only the Electron browser is displayed.
I tried to solve this issue as suggested in: Cypress 5.0 - Unable to find installed browsers
But still unable to resolve the issue and only Electron browser is shown in the tool as shown below:
when I tried to run the command npx cypress run --browser chrome it shows below error
I also tried running the command npx cypress open --browser "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
but got the below error:

WebDriverError: No active session with ID

My tests fail when am running them on TFS with the below error
WebDriverError: No active session with ID
Failed: No active session with ID
The same tests pass locally - it was working fine until couple days back, but seeing this issue now
using
protractor version - 5.4.2
Chrome driver - 2.42.exe
The problem is due to the version mismatch between the driver and browser version.
use the below version of chrome driver and corresponding browser version in you remote machine where your tests are executed
If you are using Chrome version 74, please download ChromeDriver 74.0.3729.6
If you are using Chrome version 73, please download ChromeDriver 73.0.3683.68
If you are using Chrome version 72, please download ChromeDriver 2.46
Refer here for more info http://chromedriver.chromium.org/downloads/version-selection
Hope it helps you

What is a good headless browser to run with protractor?

New User here.
After hours of building my smoke and regression tests, I found out after reading many cases online that phantomjs is known to be a trouble to run with protractor. Jenkins has been running phantomjs for all the tasks it has been given so far.
They need these tests to run as part of ci which does not have a windowing system installed.
So I would appreciate it if there is a recommendation for completely headless browser or a headless chrome(that would be most beneficial) and a step by step to set it up. I already have a conf.js and a e2e.conf.js file. My code works perfectly fine with chrome.
I am on a iMac and selenium webdriver, I believe.
Edit: Problem = protractor doesn't work with phantomjs.
What I have done = use different web elements and googled if anyone has faced a similar situation. Also googled for headless browsers that worked for protractor, unable to find a suitable solution.
If anyone reached here - the answers are outdated.
Chromium (on next release) now supports headless mode. no need to work hard.
You can read more here:
https://developers.google.com/web/updates/2017/04/headless-chrome
Here is an example from command line
chrome \
--headless \ # Runs Chrome in headless mode.
--disable-gpu \ # Temporarily needed for now.
--remote-debugging-port=9222 \
https://www.chromestatus.com # URL to open. Defaults to about:blank.
And you can simply trigger protractor with capabilities for chrome:
Activating chrome language flags when activating from protractor (selenium)
Here is the configuraiton I am using
capabilities: {
'browserName': browserName,
chromeOptions: {
binary: '/Users/guymograbi/Downloads/chrome-mac/Chromium.app/Contents/MacOS/Chromium',
args: ['--headless','--disable-gpu']
}
},
Update - new versions of chrome doesn't require binary property
In my environments I found I can remove the binary property as new version of chrome is available on stable branches
My protractor configuration is
capabilities: {
'browserName': 'chrome',
chromeOptions: {
args: [ '--headless', '--disable-gpu', '--no-sandbox', '--window-size=1920x1200' ]
},
},
And it works smoothly for weeks now. highly recommended.
Update - how to do this in karma is super easy
Using headless chrome in karma is super easy:
browsers: 'ChromeHeadless'
it should work with the chrome loader and everything. more info
Your best bet is to continue with Chrome. With a bit of work you can get it to work via a CI and in a headless manner - we do this using Jenkins and Docker Ubuntu servers which are headless.
You will need to configure Chrome to run headless using XVFB. You can start off by following the gist here https://gist.github.com/addyosmani/5336747
You state you are on a Mac so you can either run the headless tests via Docker on your machine or you could set up a second config for the CI tests.
Another resource http://tobyho.com/2015/01/09/headless-browser-testing-xvfb/
I would continue testing in normal browsers with a head, but would use a remote selenium server as a service - Sauce Labs or BrowserStack, see:
Integration Testing with Protractor, WebdriverJS and Sauce Labs
Running Protractor tests on Browserstack Automate
automate-node-samples
You could run your Protractor tests against CodeShip or Drone.io, both of which offer Chrome and/or Firefox running headless for free. No really...
If you've got Chrome 59+ installed, start Chrome with the following flag:
--headless
please let me know if you need more help, will write the config for you :) enjoy

cloud9 on ubuntu getting ace.js 404 error in chrome

I have installed cloud9 on an ocean digital server 10.04 I installed it using the latest version from git
git clone https://github.com/ajaxorg/cloud9.git
and following the github install procedure:
installation-and-usage
The install went well and the server started successfully and runs in the browser:
~/cloud9/bin/cloud9.sh -l 0.0.0.0 --username user --password pass -w ~/workspace/myproject/
When I open it in Chrome, workspace loads correctly, I can see my files, but when I try to edit a file the editor window does not open.
Checking the network tab in Chrome developer tools I can see ace.js has a 404 error
Request URL:http://myname.com:3131/static/ace/build/ace.js
I then tried running it in Firefox and I can open and edit files without problems.
Can anyone suggest what the problem might be in Chrome?
Fixed for me by following the instructions at https://github.com/ajaxorg/cloud9/issues/3242

How to debug remote v8-based application using Chrome Dev Tools

v8 has its own JSON based remote-debugging protocol and two UI debuggers:console application D8 and a eclipse plugin(hosted at http://code.google.com/p/chromedevtools)
Chrome use WebKit Remote Debugging Protocol including Console, DOM Debugger, ..., Debugger
"WebKit Remote Debugging Protocol" is a Google Chrome/Chromium debug protocol. You will find its description at http://developers.google.com/chrome-developer-tools/docs/remote-debugging
So is it possible to use the Chrome Dev Tools ships with chrome to debug remote v8-based application?
Try Node Webkit Agent for NodeJS version >= 0.6
Node-inspector is for NodeJS version 0.4
The setup need to be set in your node server and access the URL provided by the library base on your node version. You cannot use Developer Tools in Chrome directly.
node-inspector is designed to do exactly what you ask.
It seems that it competes with Node Webkit Agent. I haven't tried webkit agent yet as it seems newer and it failed to install without some meddling. node-inspector worked for me, and fairly well, although there is a bit of latency from running a statement to getting the output marshaled into Chrome's debugger. Overall, it's an extremely useful tool.

Categories