This version of ChromeDriver has not been tested with Chrome version 79 error running protractorE2E tests with ChromeDriver Chrome Selenium - selenium

Those are my settings:
.gitlab-ci.yml
image: node
stages:
- test
tests:
stage: test
before_script:
# Add Google Chrome to aptitude's (package manager) sources
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee -a /etc/apt/sources.list
# Fetch Chrome's PGP keys for secure installation
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
# Update aptitude's package sources
- apt-get -qq update -y
# Install latest Chrome stable, Xvfb packages
- apt-get -qq install -y google-chrome-stable xvfb gtk2-engines-pixbuf xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable imagemagick x11-apps default-jre
# Launch Xvfb
- Xvfb :0 -ac -screen 0 1024x768x24 &
# Export display for Chrome
- export DISPLAY=:99
# Install AngularJS CLI exclusively
# Add --unsafe-perm to resolve problems with node-gyp infinite loop on Docker
- npm install --silent --unsafe-perm -g #angular/cli#1.1.2
script:
- npm i --quiet
- npm run wd-update
- npm run wd-start &
- npm run start -- js-files/psh.conf.js
- npm run wd-shutdown
only:
- master
- merge_request
And this is the job outoput for tests
Running with gitlab-runner 12.3.0 (a8a019e0)
on runner-gitlab-runner-554cdd7fbc-4t8mw zxqBkdf4
Using Kubernetes namespace: gitlab-managed-apps
Using Kubernetes executor with image node ...
Waiting for pod gitlab-managed-apps/runner-zxqbkdf4-project-62-concurrent-15jnmx to be running, status is Pending
Running on runner-zxqbkdf4-project-62-concurrent-15jnmx via runner-
$ npm i --quiet
> canvas#2.6.0 install /builds/automation/bender/node_modules/canvas
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
[canvas] Success: "/builds/automation/bender/node_modules/canvas/build/Release/canvas.node" is installed via remote
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 457 packages from 433 contributors and audited 1390 packages in 15.657s
found 0 vulnerabilities
$ npm run wd-update
> bender#1.0.0 wd-update /builds/automation/bender
> webdriver-manager update
[15:03:41] I/file_manager - creating folder /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium
[15:03:41] I/config_source - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/standalone-response.xml https://selenium-release.storage.googleapis.com/
[15:03:41] I/config_source - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
[15:03:41] I/config_source - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/gecko-response.json https://api.github.com/repos/mozilla/geckodriver/releases
[15:03:42] I/downloader - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_78.0.3904.105.zip https://chromedriver.storage.googleapis.com/78.0.3904.70/chromedriver_linux64.zip
[15:03:42] I/downloader - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar
[15:03:42] I/update - chromedriver: unzipping chromedriver_78.0.3904.105.zip
[15:03:42] I/update - chromedriver: setting permissions to 0755 for /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_78.0.3904.105
[15:03:42] I/downloader - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
[15:03:43] I/update - geckodriver: unzipping geckodriver-v0.26.0.tar.gz
[15:03:43] I/update - geckodriver: setting permissions to 0755 for /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0
$ npm run wd-start &
$ npm run start -- js-files/psh.conf.js
> bender#1.0.0 wd-start /builds/automation/bender
> webdriver-manager start
> bender#1.0.0 prestart /builds/automation/bender
> tsc && ts-cleaner -d js-files
[15:03:44] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.gecko.driver=/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0 -Dwebdriver.chrome.driver=/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_78.0.3904.105 -jar /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar -port 4444
[15:03:44] I/start - seleniumProcess.pid: 15684
15:03:45.253 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
15:03:45.506 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2019-12-17 15:03:45.713:INFO::main: Logging initialized #1029ms to org.seleniumhq.jetty9.util.log.StdErrLog
15:03:46.441 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
15:03:46.780 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
> bender#1.0.0 start /builds/automation/bender
> node src/flake "js-files/psh.conf.js"
[15:03:52] I/launcher - Running 1 instances of WebDriver
[15:03:52] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
15:03:52.446 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "chrome",
"chromeOptions": {
"args": [
"--headless",
"--no-sandbox",
"--window-size=1550,768"
]
},
"count": 1,
"maxInstances": 1,
"shardTestFiles": false
}
15:03:52.449 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904#{#800}) on port 3722
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1576595032.499][SEVERE]: bind() failed: Cannot assign requested address (99)
[1576595033.109][WARNING]: This version of ChromeDriver has not been tested with Chrome version 79.
15:03:53.266 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
15:03:53.323 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 26b7b655c1318cbcde9cfb69871f56ad (org.openqa.selenium.chrome.ChromeDriverService)
(node:15719) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Started
Jasmine started
2019-12-17T15:03:53.447Z - info: Current test running:
Psh site validations Site language should change
(node:15719) UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'runner-zxqbkdf4-project-62-concurrent-15jnmx', ip: '10.36.0.39', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.138+', java.version: '1.8.0_232'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:509:13)
at /builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:15719) UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'runner-zxqbkdf4-project-62-concurrent-15jnmx', ip: '10.36.0.39', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.138+', java.version: '1.8.0_232'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:509:13)
at /builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15719) UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'runner-zxqbkdf4-project-62-concurrent-15jnmx', ip: '10.36.0.39', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.138+', java.version: '1.8.0_232'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:509:13)
at /builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
So, the error that I having is:
UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Any idea about this?
I was researching about two days at least and I didn't found anything related, I see a lot of errors but no one like this.
Should I use a docker image? instead install everything on the fly?
I couldn't find a docker image that match with my necessity.
Is the seleniumaddress that I'm using correct?
It's the one recommended by protractor site: seleniumAddress: 'http://localhost:4444/wd/hub'

This error message...
Starting ChromeDriver 78.0.3904.70
.
[1576595033.109][WARNING]: This version of ChromeDriver has not been tested with Chrome version 79.
.
15:03:53.323 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 26b7b655c1318cbcde9cfb69871f56ad (org.openqa.selenium.chrome.ChromeDriverService)
(node:15719) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=78.0
Release Notes of chromedriver=78.0 clearly mentions the following :
Supports Chrome version 78
You are using chrome= 79.0
Release Notes of ChromeDriver v79.0 clearly mentions the following :
Supports Chrome version 79
So there is a clear mismatch between the ChromeDriver v78.0 and the Chrome Browser v79.0
Solution
Ensure that:
ChromeDriver is updated to current ChromeDriver v79.0 level.
Chrome is updated to current Chrome Version 79.0 level. (as per ChromeDriver v79.0 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Reference
You can find a relevant detailed discussion in:
How to work with a specific version of ChromeDriver while Chrome Browser gets updated automatically through Python selenium

If you are using npm implementation of protractor type below command in cmd . Today by chrome version was changed to 79 and doing this solved my issue .
webdriver-manager update

Related

Laravel + sail + dusk => Error: Could not start a new session [...] Chrome failed to start

I just can't get Laravel dusk running. I've searched the internet and tried almost everything. I hope anyone knows the trick.
To rule out any self introduced problems I stated with a brand new Laravel project: curl -s "https://laravel.build/example-app" | bash. I'm using a Macbook Air (M1 chip) and therefore I have to change the docker-compose.yml and add platform=linux/amd64 to the containers. Thereafter ran ./vendor/bin/sail build and started up the containers. Next installed Dusk: ./vendor/bin/sail composer require --dev laravel/dusk and ran the install command (./vendor/bin/sail artisan dusk:install) as by the documentation.
At this point no additional modifications in any file have been made. Laravel Dusk ships with the default browser test. (tests/Browser/ExampleTest.php) When I run the command ./vendor/bin/sail dusk the following error will show:
1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.
(chrome not reachable)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '64671e354051', ip: '192.168.32.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '64671e354051', ip: '192.168.32.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown
/var/www/html/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php:125
/var/www/html/vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php:372
/var/www/html/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php:131
/var/www/html/tests/DuskTestCase.php:46
/var/www/html/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:219
/var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php:243
/var/www/html/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:220
/var/www/html/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:98
/var/www/html/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:66
/var/www/html/tests/Browser/ExampleTest.php:21
What I tried
The files in ./vendor/laravel/dusk/bin/ have the right permissions.
./vendor/bin/sail artisan dusk:chrome-driver --all => ChromeDriver binary successfully installed for version 100.0.4896.60. . But the same dusk error will show.
Tried to run the ChromeDriver directly: ./vendor/bin/sail bash => ./vendor/laravel/dusk/bin/chromedriver-linux. This results in an error:
./vendor/laravel/dusk/bin/chromedriver-linux: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
I Found an other StackOverflow post to fix this issue by installing the following packages via the sail root-shell: apt update; apt install libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev;. Now the chromedriver-linux is starting without errors. Dusk still fails with the same error.
Has anyone a clue?
I was getting the same error when running sail artisan dusk.
When started using sail dusk instead everything worked.

How to set chromeDriver location in Protractor project

In my Protractor project I get below error when execute npm test command
21:55:20] E/runner - Unable to start a WebDriver session.
[21:55:20] E/launcher - Error: SessionNotCreatedError: Unable to create new service: ChromeDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '00000FJ26VN2', ip: '172.30.161.17', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: driver.version: unknown
I tried below solution and didn't work for me.
Solution 1
This couldn't do due to my machine restriction
Other question I have is even after replacing the correct chromedriver in the below location when I start the server it still shows the wrong one. (i.e. chromedriver_75.0.3770.8.exe, But I replace that with chromedriver_74.0.3729.6.exe which is my current browser version.
File Location: protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium
logs when start the server
λ npm run webdriver-start
> protractor-typescript-cucumber#4.0.0 webdriver-start c:\Repository\GitExt\Protractor\protractor-cucumber-typescript
> webdriver-manager start
[22:08:04] I/start - java -Dwebdriver.chrome.driver=c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_75.0.3770.8.exe -Dwebdriver.gecko.driver=c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\geckodriver-v0.24.0.exe -jar c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-3.141.59.jar -port 4444
[22:08:04] I/start - seleniumProcess.pid: 1380
22:08:04.708 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
22:08:04.825 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2019-06-13 22:08:04.883:INFO::main: Logging initialized #446ms to org.seleniumhq.jetty9.util.log.StdErrLog
22:08:05.145 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
22:08:08.881 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
So as a resolution Can I pointing to the chromedriver specifically? What is the relationship between selenium-server-standalone-3.141.59.jar and the chromedriver? Is there a way to find the compatible chromedriver version for this jar
In my case I don't have access to update or downgrade my machine chrome browser version. So how it's possible to change the web driver version to align with chrome browser version.
I figured out the issue here and managed to have resolution.
Problem : Even though I placed the matching chromedriver.exe in path (c:\Repository\GitExt\Protractor\protractor-cucumber-typescript\node_modules\protractor\node_modules\webdriver-manager\selenium) it's still looking for the original version which is coming fromwebdriver-update command.
So what I did was
Removed chromedriver from the above path.
Add the preferred one in some folder location and set that in env. variables. So if the driver is missing in the project folder it always goes to set path in the env. variables which the right one.
Despite of above solution I just wondering how I can change the driver version when run webdriver-update command?

Running Protractor for the first time on a container and it fails with errors

I'm running a Protractor Sample application and it fails on the container.
I tried the same application ona physical machine and it works as expected and passses the test case.
My Test code: -->CheckTitleSpec.js
//CheckTitleSpec.js2
describe('Protractor Demo', function() {
it('to check the page title', function() {
browser.ignoreSynchronization = true;
browser.get('https://www.softwaretestinghelp.com/');
browser.driver.getTitle().then(function(pageTitle) {
expect(pageTitle).toEqual('Software Testing Help - Free Software Testing & IT Tutorials and Courses');
});
});
});
The conf.js File
// conf.js
exports.config = {
framework: 'jasmine',
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ["--headless", "--disable-gpu", "--window-size=800x600"]
}
},
specs: ['CheckTitleSpec.js']
};
The Docker file for building the Container:
FROM node:latest
USER root
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install software-properties-common
RUN apt-get install default-jre -y
RUN npm install -g protractor
RUN webdriver-manager update
RUN npm install protractor-jasmine2-screenshot-reporter
# Install Chrome
RUN wget https://dl.google.com/linux/direct/google-chrome- stable_current_amd64.deb
RUN apt install ./google-chrome-stable_current_amd64.deb -y
COPY CheckTitleSpec.js /
COPY conf.js /
ENTRYPOINT [ "sh", "-c", "protractor /conf.js" ]
On the container the output is:
java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.212-b12, mixed mode)
webdriver-manager version
I/version - webdriver-manager 12.1.4
node -v
v11.12.0
npm -v
6.7.0
protractor --version
Version 5.4.2
google-chrome --version
Google Chrome 74.0.3729.131
protractor conf.js
[10:32:53] I/launcher - Running 1 instances of WebDriver
[10:32:53] I/local - Starting selenium standalone server...
[10:32:55] I/local - Selenium standalone server started at http://172.17.0.2:49496/wd/hub
[10:32:56] E/launcher - unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch- heads/3729#{#29}),platform=Linux 4.9.125-linuxkit x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 147 milliseconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '153e772db9cd', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.125-linuxkit', java.version: '1.8.0_212'
Driver info: driver.version: unknown
[10:32:56] E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch- heads/3729#{#29}),platform=Linux 4.9.125-linuxkit x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 147 milliseconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '153e772db9cd', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.125-linuxkit', java.version: '1.8.0_212'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/usr/local/lib/node_modules /protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/usr/local/lib/node_modules/protractor /node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/usr/local/lib/node_modules/protractor /node_modules/selenium-webdriver/lib/http.js:441:30)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
From: Task: WebDriver.createSession()
at Function.createSession (/usr/local/lib/node_modules /protractor/n ode_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:761:15)
at createDriver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:170:33)
at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:626:16)
at Local.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:53:33)
at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:195:43)
at q.then.then (/usr/local/lib/node_modules/protractor/built/runner.js:339:29)
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules /protractor/node_modules/q/q.js:796:13)
[10:32:56] E/launcher - Process exited with error code 199
I tested the same code on a Physical Linux box headless and it works as expected.
Any leads is greatly appreciated.
Thank you.
I've seen several answers similar to the one posted here. Those answers suggest using --no-sandbox and --disable-dev-shm-usage flags as a workaround.
In your config, add these flags like so:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
'--no-sandbox',
'--disable-dev-shm-usage'
]
}
}

org.openqa.selenium.SessionNotCreatedException because of "Chrome version must be >= 64.0.3282.0" although version is 65.0.3325.181 on Travis CI

While I was attempting to extend Arquillian PrimeFaces's .travis.yml with a setup for phantomjs and chromeheadless browser driver for functional tests with Selenium, I experienced
java.lang.RuntimeException: Could not create statement
Caused by: java.lang.RuntimeException:
Unable to instantiate Drone via org.openqa.selenium.chrome.ChromeDriver(Capabilities): org.openqa.selenium.SessionNotCreatedException: session not created exception: Chrome version must be >= 64.0.3282.0
(Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Linux 4.4.0-101-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 564 milliseconds
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T18:33:54.468Z'
System info: host: 'travis-job-bdbf5b81-b2fa-4377-b5de-da7743f04986', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-101-generic', java.version: '1.8.0_151'
Driver info: driver.version: ChromeDriver
Caused by: org.openqa.selenium.SessionNotCreatedException:
session not created exception: Chrome version must be >= 64.0.3282.0
(Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Linux 4.4.0-101-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 564 milliseconds
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T18:33:54.468Z'
System info: host: 'travis-job-bdbf5b81-b2fa-4377-b5de-da7743f04986', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-101-generic', java.version: '1.8.0_151'
Driver info: driver.version: ChromeDriver
So, I updated chromium-browser with sudo add-apt-repository --yes ppa:saiarcot895/chromium-dev && sudo apt-get update && sudo apt-get install --yes chromium-browser and verified that it's the only Chrome binary and has a matching version with which -a chromium-browser && chromium-browser --version which reveals that the only binary is /usr/bin/chrominum-browser and has version 65.0.3325.181. However, the error persists.
I researched and found issues with Chrome on Travis CI like
https://github.com/travis-ci/travis-ci/issues/938 which is about permissions (as opposed to versions)
Chromedriver on Travis-CI which summarizes issues
and checked the Arquillian web driver configuration options for Chrome which don't seem to include one to expose the actual pick up of the ghost 64.x binary.
An example run of the failure can be found at https://travis-ci.org/krichter722/arquillian-primefaces/jobs/364342730.
In your question you have mentioned about using Chrome v65.0.3325.181 but the error stack strace shows different versions as follows :
Caused by: org.openqa.selenium.SessionNotCreatedException:
session not created exception: Chrome version must be >= 64.0.3282.0
This essentially means ChromeDriver is unable to detect the right version of chrome binary. It appears you either have installed multiple instances of Chrome Browsers and have multiple instances of chrome binaries within your system or there are multiple stray instances of chrome binaries available within your system.
Solution
You must ensure that Chrome is installed at the optimum location as the server expects you to have Chrome installed in the default location for each system as per the snapshot below :
Note : For Linux systems, the ChromeDriver expects /usr/bin/google-chrome to be a symlink to the actual Chrome binary. You can also override the Chrome binary location following the documentation Using a Chrome executable in a non-standard location.
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.

Headless Chrome Circle CI - Error: spawn /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/bin/java ENOENT

I am trying to run tests in Circle CI in headless chrome.
I am using selenium server version 3.8.1 and chromedriver version 2.34
protractor_conf.js consists of chrome capabilities as:
var chromeCapabilities = {
browserName: 'chrome',
chromeOptions: {  
args: [
'headless','--show-fps-counter=false', '--remote-debugging-port=2222', '--disable-gpu'
]
}
}
My sh script includes following commands for webdriver-manager and then running tests:
./node_modules/protractor/bin/webdriver-manager clean
./node_modules/protractor/bin/webdriver-manager update --gecko false --versions.standalone 3.8.1 --versions.chrome 2.34
./node_modules/protractor/bin/webdriver-manager start &
echo "*** Run script for e2e tests"
gulp e2e
I added these in m circle.yml to install latest version of stable chrome and launched headless listening to localhost:
dependencies:
post:
# Install the latest Chrome
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
- rm google-chrome.deb
before_install:
- google-chrome --headless --remote-debugging-port=2222 --disable-gpu http://localhost &
So, when I run my build now, the tests don't run at all. Logs say:
** Updating webdriver **
[05:46:11] W/file_manager - path does not exist
/home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-
manager/selenium
[05:46:11] I/file_manager - creating folder
/home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-
manager/selenium
[05:46:12] I/update - chromedriver: unzipping chromedriver_2.34.zip
[05:46:12] I/update - chromedriver: setting permissions to 0755 for
/home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-
manager/selenium/chromedriver_2.34
[05:46:13] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.chrome.driver=/home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.34 -jar /home/ubuntu/pharma/test/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.8.1.jar -port 4444
[05:46:13] I/start - seleniumProcess.pid: 24198
05:46:13.642 INFO - Selenium build info: version: '3.8.1', revision: '6e95a6684b'
05:46:13.643 INFO - Launching a standalone Selenium Server
2018-01-12 05:46:13.740:INFO::main: Logging initialized #385ms to org.seleniumhq.jetty9.util.log.StdErrLog
05:46:13.781 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
05:46:13.799 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
05:46:13.801 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
05:46:13.803 INFO - Driver class not found: com.opera.core.systems.OperaDriver
05:46:13.803 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
05:46:13.803 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
05:46:13.804 INFO - Driver class not found: org.openqa.selenium.phantomjs.PhantomJSDriver
05:46:13.845 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities {browserName: internet explorer, ensureCleanSession: true, platform: WINDOWS, version: } does not match the current platform LINUX
05:46:13.845 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities {browserName: MicrosoftEdge, platform: WINDOWS, version: } does not match the current platform LINUX
05:46:13.846 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities {browserName: safari, platform: MAC, version: } does not match the current platform LINUX
05:46:13.891 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
05:46:13.892 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
05:46:13.892 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
05:46:13.893 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
05:46:13.893 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
05:46:13.902 INFO - Using the passthrough mode handler
2018-01-12 05:46:13.932:INFO:osjs.Server:main: jetty-9.4.7.v20170914
2018-01-12 05:46:13.970:WARN:osjs.SecurityHandler:main: ServletContext#o.s.j.s.ServletContextHandler#2db7a79b{/,null,STARTING} has uncovered http methods for path: /
2018-01-12 05:46:13.978:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#2db7a79b{/,null,AVAILABLE}
2018-01-12 05:46:13.998:INFO:osjs.AbstractConnector:main: Started ServerConnector#67b467e9{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2018-01-12 05:46:13.999:INFO:osjs.Server:main: Started #644ms
05:46:13.999 INFO - Selenium Server is up and running
[07:02:53] Using gulpfile ~/pharma/test/gulpfile.babel.js
[07:02:53] Starting 'set-envVars'...
[07:02:53] Finished 'set-envVars' after 245 μs
[07:02:53] Starting 'set-directories'...
[07:02:53] Finished 'set-directories' after 428 μs
[07:02:53] Starting 'e2e'...
--> Running tests using command: ./node_modules/.bin/protractor ./protractor_e2e_conf.js
Logger: Output file - /home/ubuntu/pharma/test/output/e2e/logs/console.log
[07:02:54] [INFO] Report destination: /home/ubuntu/pharma/test/output/e2e/logs/e2eTests.html
[07:02:54] [INFO] [07:02:54] I/launcher - Running 1 instances of WebDriver
[07:02:55] [INFO] [07:02:55] I/testLogger -
------------------------------------
[07:02:55] [INFO] [07:02:55] I/testLogger - [Chrome] PID: 24232
[Chrome] Specs: /home/ubuntu/pharma/test/e2e/spec/targeting/data_upload/uploadAccount_spec.js
[Chrome]
[Chrome] Logger: Output file - /home/ubuntu/pharma/test/output/e2e/logs/console.log
[Chrome] [07:02:55] [INFO] [07:02:55] I/local - Starting selenium standalone server...
[Chrome] events.js:160
[Chrome] throw er; // Unhandled 'error' event
[Chrome] ^
[Chrome]
[Chrome] Error: spawn /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/bin/java ENOENT
[Chrome] at exports._errnoException (util.js:1018:11)
[Chrome] at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
[Chrome] at onErrorNT (internal/child_process.js:367:16)
[Chrome] at _combinedTickCallback (internal/process/next_tick.js:80:11)
[Chrome] at process._tickCallback (internal/process/next_tick.js:104:9)
Versions used:
Chrome browser version: Google Chrome 63.0.3239.132
Protractor:v5.2.2
Chromedriver zip: 2.34
Selenium standalone: 3.8.1
Circle CI: 1.0
What am I missing?
Any help would be appreciated.
Solution:
The default java version installed on circle ci is 1.7. I forced it to install 1.8 jdk:
Went to circle ci build test commands and used: java --version command to check java version installed. Got v1.7 form there.
Then, I modified my Dockerfile to use jdk 8 by using: FROM openjdk:8
This would overwrite the v1.7 installed and force use 1.8 which solved my problem.