Behat selenium Chromedriver CreatePlatformSocket error - google-chrome

I am trying to run test with selenium and chromedriver.
i have a centos 6.7 installed chrome and used chrome lib from chromedriver ( found script here https://chrome.richardlloyd.org.uk/)
front:
extensions:
Behat\MinkExtension:
base_url: 'http://urlfront/'
browser_name: chrome
sessions:
default:
selenium2:
wd_host: 'http://127.0.0.1:4444/wd/hub'
capabilities:
browser: chrome
suites:
front:
filters:
tags: front
admin:
extensions:
Behat\MinkExtension:
base_url: 'http://url/'
browser_name: chrome
sessions:
default:
selenium2:
wd_host: 'http://localhost:4444/wd/hub'
capabilities:
browser: chrome
suites:
admin:
filters:
tags: admin
this is my behat .yml
im starting selenium with this command :
java -jar selenium-server-standalone.jar -trustAllSSLCertificates -Djava.net.preferIPv4Stack=true -Dwebdriver.chrome.driver=chromedriver -Dwebdriver.chrome.bin=/opt/google/chrome/google-chrome
when I run behat, i got an error on selenium
[27,690][SEVERE]: CreatePlatformSocket() returned an error, errno=97: Famille d'adresses non supportée par le protocole ( address family not supported)
this error loop for a while and at the end it show me this
12:01:01.718 WARN - Exception: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1),platform=Linux 2.6.32-573.el6.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
I don't know where to search, is that an error from chrome not starting or protocol not supported or both ?
hope someone can help me on this I tried a lot of things reinstalled chrome with the script but maybe it was not cleaned and I still have a wrong version ?

Related

Protractor won't run chrome

Protractor was running fine but suddenley won't run chrome anymore. This is mye current configuration:
exports.config = {
baseUrl: 'http://localhost:1384/#/',
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['./tests/e2e/*.js'],
multiCapabilities: [{
//'browserName': 'firefox',
'browserName': 'chrome',
},
],
jasmineNodeOpts: {
showColors: true
}
}
I am running latest of all the related dependencies:
protractor : "protractor": "^5.2.0",
chromedriver: 2.33.506092
webdriver: selenium standalone version available: 3.7.1 [last]
when I run webdriver-manager start eveything runs fine, and then running protractor conf.js gives the following output in the window running the selenium server:
Starting ChromeDriver 2.33.506092 Only local connections are allowed.
The terminal windows running the protractor config, gives the following errros:
E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally
I have already tried reinstalling protractor and updating the chromedriver. Running the tests work fine in firefox with the exact same configurations.
I am also running tests with karma, and karma runs fine in a chrome browser window.
Add directConnect: true to your config file. It might help you.
this would be your conf file
exports.config = {
directConnect: true,
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome',
},
// Framework to use. Jasmine is recommended.
framework: 'jasmine',
baseUrl: "YOUR URL",
// Spec patterns are relative to the current working directory when
// protractor is called.
specs: ['../Tests/test.js'],
// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
},
};
you don't need to give below dependencies because chrome get launched from conf file only
chromedriver: 2.33.506092
webdriver: selenium standalone version available: 3.7.1 [last]
Ran into similar issue. Try updating chrome which should fetch the new compatible chrome driver.

“cannot get automation extension” error with chrome version: 57.0.2987.98

chrome version : 57.0.2987.98 m (64-bit)
"protractor": "4.0.11",
"protractor-console-plugin": "0.1.1",
"protractor-jasmine2-html-reporter": "0.0.6",
"protractor-notify-plugin": "1.0.0",
protractor failed to launch chrome with the following error:
unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=57.0.2987.98)
(Driver info: chromedriver=2.26.436362 (5476ec6bf7ccbada1734a0cdec7d570bb042aa30),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.10 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
You are using incompatible versions of chromedriver=2.26.436362 and chrome=57.0.2987.98.
As per Chrome driver release notes the error is fixed in ver 2.28 so you should upgrade your Chrome driver (or downgrade the Chrome browser).
upd: if you use angular/webdriver-manager to run Selenium server then you can achieve this by running the following commands:
webdriver-manager update --versions.chrome=2.28
webdriver-manager start --versions.chrome=2.28
Yes, you can use this as a workaround
node ./node_modules/protractor/bin/webdriver-manager update --versions.chrome 2.28
node ./node_modules/protractor/bin/webdriver-manager start --versions.chrome 2.28
Works for my team. Hope it can help you.
Upgrading your protractor version to 5+ should do it. I got the same error, upgraded from 4.0.14 to 5.1.1, and now all my UI tests are passing again.
It seems that protractor doesn't start grabbing the latest version of the chrome driver until Protractor version 5.0, so when you upgrade to a version of Chrome that's incompatible with protractor's chrome driver, it will break your tests in this fun new way.
Source: https://github.com/angular/protractor/blob/master/CHANGELOG.md
This might be because webdriver failed to deal with 3-party Chrome extension.
You can try to set below capabilities in your conf.js file to disable extensions usage:
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['--disable-extensions']
}
}

WebDriverError: unknown error: Chrome failed to start: exited abnormally

What I'm trying to achieve
Successfully run my protractor tests on headless chrome on Ubuntu 14 non gui.
Set up
Using multiple reference pages I have managed to successfully install: Xvfb Chrome latest browser Protractor 3.3.0 Java 7 (also tried with Java 8) and also set the LOCAL_HOME. Also, managed to start the Xvfb using this reference.
Protractor conf
exports.config = {
baseUrl: 'http://<qa environment>',
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
jasmineNodeOpts: {
showColors:true,
defaultTimeoutInterval: 2500000
},
capabilities: {
'browserName': 'chrome'
},
specs: ['administration/*-spec.js'], //'signinandout/*-spec.js', 'homepage/*-spec.js',
onPrepare: function(){
//browser.driver.manage().window().setSize(1280, 1080);
}
}
Exception stack trace:
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/error.js:26
constructor(opt_error) {
^ WebDriverError: unknown error: Chrome failed to start: exited abnormally (Driver info:
chromedriver=2.21.371461
(633e689b520b25f3e264a2ede6b74ccc23cb636a),platform=Linux
3.13.0-87-generic x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 60.16 seconds
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11
19:06:42' System info: host: 'vagrant-ubuntu-trusty-64', ip:
'10.0.2.15', os.name: 'Linux', os.arch: 'amd64', os.version:
'3.13.0-87-generic', java.version: '1.7.0_101' Driver info:
org.openqa.selenium.chrome.ChromeDriver
at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/error.js:26:26)
at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/error.js:580:13)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:64:13
at Promise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1329:14)
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2790:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2773:21)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2652:27
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (internal/process/next_tick.js:103:7) From: Task: WebDriver.createSession()
at acquireSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:62:22)
at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:295:12)
at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:458:24)
at Hosted.DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:37:33)
at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:182:43)
at /usr/local/lib/node_modules/protractor/built/runner.js:255:30
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/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)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49
[01:09:14] E/launcher - Process exited with error code 1
Check your Google chrome Version and its compatibility with the chrome driver.
You can check that from the Chromedriver Site and download the compatible version.
It worked for me.
probably your window screen size is not matching try giving maximize in onPrepare:
onPrepare: function(){
browser.driver.manage().window().maximize();
}
Open your project and Please update your npm modules by the following command.
project_root:\> npm update
Now update your selenium driver to the latest version using the following command
project_root:\> webdriver-manager update
Run your tests again.
Error due to Xvfb display is not specified here. Here , Selenium scripts are running using headless browser testing concept which is without GUI.
Hope u have used chromedriver, chrome binaries and XVfb. here chromedriver is initializing chrome binaries but chrome binary not able to sits on the monitor with XVfb .Thats y its throwing error as " Chrome failed to start:exit abnormally"
please follow the below steps before executing ur script.Example:(Execute this cmd in ur Unix server (ex.putty))
usr/bin/Xvfb :2 -ac -screen 0 1280x1024x24 &
export DISPLAY=:2
It will work definitely.

Error when running sitespeed.io with chrome : Chrome failed to start: exited abnormally

I was running this command on the terminal
$ sitespeed.io -u http://cybercom.com -b chrome
but always facing this error, I have tried many times but in vain cannot figure out the problem
message: 'unknown error: Chrome failed to start: exited abnormally\n (Driver info: chromedriver=2.16.333243 (0bfa1357514444f1ddb82bf70944f96),platform=Linux 3.13.0-65-generic x86_64)'
knowing that
1-Os version :
Ubuntu 14.04.3 LTS
2-my google chrome version is
$ google-chrome -version
Google Chrome 46.0.2490.71
3-chrome driver version
$ chromedriver -version
ChromeDriver 2.10.267518
but in the message error it is "Driver info: chromedriver=2.16.333243" .... I didn´t understand why they aren´t the same version ?
Google chrome version is not supported neither with chromedriver=2.16 nor with ChromeDriver 2.10.
----------ChromeDriver v2.16 (2015-06-08)----------
Supports Chrome v42-45
----------ChromeDriver v2.10 (2014-05-01)----------
Supports Chrome v33-36
what should I do in this case ?
I appreciate your help . Thx

Running "karma:unit" (karma) task WARN [reporter]: Can not load "html", it is not registered! Perhaps you are missing some plugin?

I'm getting following warn when I ran grunt test and doesn't give me the expected result, which is writing the progress of unit tests.
error:-
Running "karma:unit" (karma) task
WARN [reporter]: Can not load "html", it is not registered!
Perhaps you are missing some plugin?
INFO [karma]: Karma v0.12.15 server started at http://localhost:8080/
INFO [launcher]: Starting browser Chrome
WARN [watcher]: Pattern "F:/AngularExamples/TestingAngular/test/mock/**/*.js" do
es not match any file.
INFO [Chrome 34.0.1847 (Windows 7)]: Connected on socket Mxn9RZeJcSW1gjL_e3d2 wi
th id 36948068
Chrome 34.0.1847 (Windows 7): Executed 1 of 1 SUCCESS (0.04 secs / 0.037 secs)
Done, without errors.
html report plugin integration in karma.config.js :-
reporters: ['progress', 'html'],
// the default configuration
htmlReporter: {
outputDir: 'karma_html',
templatePath: __dirname+'/jasmine_template.html'
},
can someone point me the cause?
First, make sure it has been installed - there should be a karma-html-reporter directory in node_modules in the directory from which you are running the tests. If not run:
npm install karma-html-reporter
Then confirm you have 'karma-html-reporter' in plugins in the conf, i.e:
plugins: [
'karma-teamcity-reporter',
'karma-jasmine',
'karma-coverage',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-html-reporter'
]