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.
Related
I'm trying to run "ng e2e" command with octopus with following configuration but getting below error all the time:
[07:20:37] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 79
(Driver info: chromedriver=79.0.3945.16 (93fcc21110c10dbbd49bbff8f472335360e31d05-refs/branch-heads/3945#{#262}),platform=Windows NT 10.0.14393 x86_64)
[07:20:37] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 79
(Driver info: chromedriver=79.0.3945.16 (93fcc21110c10dbbd49bbff8f472335360e31d05-refs/branch-heads/3945#{#262}),platform=Windows NT 10.0.14393 x86_64)
at Object.checkLegacyResponse (D:\a\1\s\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (D:\a\1\s\node_modules\selenium-webdriver\lib\http.js:509:13)
at D:\a\1\s\node_modules\selenium-webdriver\lib\http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:93:5)
From: Task: WebDriver.createSession()
at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\chrome.js:761:15)
at Direct.getNewDriver (D:\a\1\s\node_modules\protractor\built\driverProviders\direct.js:77:33)
at Runner.createBrowser (D:\a\1\s\node_modules\protractor\built\runner.js:195:43)
at D:\a\1\s\node_modules\protractor\built\runner.js:339:29
at _fulfilled (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:834:54)
at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:863:30
at Promise.promise.promiseDispatch (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:796:13)
at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:137:13)
[07:20:37] E/launcher - Process exited with error code 199
An unexpected error occurred: undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rebar-spa-v2-template#0.0.3 e2e: `ng e2e`
Configuration is:
user-agent = "npm/6.12.1 node/v12.13.1 win32 x64"
Protractor.conf.js:
capabilities: {
'browserName': 'chrome',
chromeOptions: {
args: ['--headless', '--disable-gpu', '--window-size=800,600']
}
},
Package.json: tried with both of solution
postinstall: webdriver-manager update --versions.chrome 79.0.3945.36
or
postinstall: cd ./node_modules/protractor && npm i webdriver-manager#latest
Any help will be appreciated.
This error message...
session not created: This version of ChromeDriver only supports Chrome version 79 (Driver info: chromedriver=79.0.3945.16 (93fcc21110c10dbbd49bbff8f472335360e31d05-refs/branch-heads/3945#{#262}),platform=Windows NT 10.0.14393 x86_64)
...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=79.0.3945.16
Release Notes of chromedriver=79.0.3945.16 clearly mentions the following :
Supports Chrome v79
Presumably you are using a Chrome with a version other then chrome= 79.0
Possibly the following command fails:
webdriver-manager update --versions.chrome 79.0.3945.36
So there is a clear mismatch between the ChromeDriver v79.0 and your current Chrome Browser
Solution
Ensure the following mentioned steps will solve the issue:
You may need to clean up once:
webdriver-manager clean
You have the latest version of webdriver-manager and you can install the same using the command:
webdriver-manager#latest --save
Execute the following command will solve your issue:
webdriver-manager update
Upgrade Chrome to the latest stable release:
webdriver-manager update --versions.chrome 79.0.3945.88
I got this message when my system downloaded Chrome 90 in the background, even though my browser still said 89 (to be fair it was prompting me to update). I tried a few things but in the end I just ran npm uninstall chromedriver and then npm install chromedriver and everything started working again. Not ideal but I'm happy my tests are able to run.
EDIT:
I noticed that running the above commands updated my package.json file so it now said "chromedriver": "^90.0.0" in it. I'm guessing I could have made that version change myself and run npm install chromedriver to download the updated driver file. I'll try that next time.
The reason for me was that chromedriver was installed globally. Need just do npm i chromedriver -g
I have recently updated ChromeDriver to 2.36 after chrome was auto updated to v65.
But on running test now i am getting below exceptions
Starting ChromeDriver 2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91) on port 10482
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: failed to write automation extension zip
(Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 218 milliseconds
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: '172.16.27.222', ip: '172.16.123.114', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_77'
Driver info: driver.version: ChromeDriver
Have tried both chromeOptions & DesiredCapabilties
ChromeOptions o = new ChromeOptions();
o.addArguments("disable-extensions");
o.addArguments("--start-maximized");
ChromeDriver chromeDriver = new ChromeDriver(o);
return chromeDriver;
Also tried below method :
ChromeDriver chromeDriver = new ChromeDriver(capabilities);
chromeDriver.manage().window().maximize();
The error says it all :
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: failed to write automation extension zip
(Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 218 milliseconds
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: '172.16.27.222', ip: '172.16.123.114', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_77'
Driver info: driver.version: ChromeDriver
It is clear from your error stack trace that the driver.version is not getting recognized.
Your main issue is the version compatibility between the binaries you are using as follows :
You are using chromedriver=2.36
You are using chrome=65.0 (as per your question)
You are using Selenium Client v3.11.0
Your JDK version is 1.8.0_77 which is pretty ancient.
So there is a clear mismatch between the JDK v8u77 , Selenium Client v3.11.0 , ChromeDriver version (v2.36) and the Chrome Browser version (v65.0)
Solution
Upgrade JDK to recent levels JDK 8u162.
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 Chrome version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Chrome.
Execute your #Test.
Additional Considerations
If you intend to use ChromeDriver and Chrome Browser, while initializing the WebDriver instance instead of using the ChromeDriver implementation use the WebDriver interface as follows :
WebDriver chromeDriver = new ChromeDriver(o);
If you intend to maximize the browser window, instead of using chromeDriver.manage().window().maximize(); use the ChromeOptions instance as follows :
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
Here are the arguments I use:
ArrayList<String> args = new ArrayList<String>();
args.add("enable-automation");
args.add("test-type=browser");
args.add("disable-plugins");
args.add("disable-infobars");
args.add("disable-extensions");
options.put("args", args);
I think you need to at least add the "enable-automation" argument.
I recently upgraded my chrome version to 60 and chromedriver to version 2.31. Post that I have started getting the following exception when I try to do a maximize of the browser window.
driver.driver.manage().window().maximize()
org.openqa.selenium.WebDriverException: unknown error: failed to
change window state to maximized, current state is normal (Session
info: chrome=60.0.3112.78) (Driver info: chromedriver=2.31.488763
(092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux
4.2.0-27-generic x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 108 milliseconds
Build info: version: '2.53.1', revision:
'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30
19:26:09' System info: host: 'bb-blr-prod-stage-stg1-01', ip:
'10.3.211.2', os.name: 'Linux', os.arch: 'amd64', os.version:
'4.2.0-27-generic', java.version: '1.7.0_80' Session ID:
c7de7149dd490cc7760d2f4fc49f0325 Driver info:
org.openqa.selenium.chrome.ChromeDriver Capabilities [{platform=LINUX,
acceptSslCerts=true, javascriptEnabled=true, browserName=chrome,
chrome={userDataDir=/tmp/.org.chromium.Chromium.WABPhO,
chromedriverVersion=2.31.488763
(092de99f48a300323ecf8c2a4e2e7cab51de5ba8)},
networkConnectionEnabled=false, unexpectedAlertBehaviour=,
rotatable=false, setWindowRect=true, locationContextEnabled=true,
mobileEmulationEnabled=false, pageLoadStrategy=normal,
version=60.0.3112.78, takesHeapSnapshot=true,
cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true,
browserConnectionEnabled=false, webStorageEnabled=true,
nativeEvents=true, hasTouchScreen=false,
applicationCacheEnabled=false, takesScreenshot=true}]
I run my tests in headless mode using ChromeDriver on Geb.
Chrome version - 60.0.3112.78
chromedriver version - 2.31.488763
OS - Ubuntu 14.04.4 LTS
Selenium version - 2.53.1
WebDriver Language Bindings
Geb - 0.13.1
Since you're running tests in a headless mode, there is no active browser window available. As such your
driver.driver.manage().window().maximize()
would always fail in such situations because the driver doesn't know which window to maximize since there aren't any available.
You can either follow what #DebanjanB has mentioned or you can start the headless browser with a specific screen size like 1440x900 etc, doing something like this
driver.manage().window().setSize(new Dimension(1440, 900));
[Edit] In most cases now that I've seen that the maximize() method works in headless too - however I've not tested this on a CI system.
Add below ChromeOption in your code :
options.addArguments("--window-size=1325x744");
Also refer this blog for more
This is an open bug (follow here) : https://bugs.chromium.org/p/chromedriver/issues/detail?id=1901
There seems to be a minor discrepancy in the line of code:
driver.driver.manage().window().maximize()
You need to replace this line of code with:
driver.manage().window().maximize()
In case this solution doesn't address your issue, to use Google Chrome in headless you can use either of the following solutions:
Using start-maximized
It is recommended to maximize the Google Chrome browser through ChromeOptions class as follows:
Code Block:
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
options.addArguments("--headless");
options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com/");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(".\\Screenshots\\using-start-maximized.png"));
driver.quit();
Browser Snapshot:
Using --window-size=1400,600
As an alternative you can also add the argument for the expected window size as follows:
Code Block:
ChromeOptions options = new ChromeOptions();
options.addArguments("--window-size=1400,600");
options.addArguments("--headless");
options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com/");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(".\\Screenshots\\using-window-size.png"));
driver.quit();
Browser Snapshot:
Using setSize(new Dimension(1440, 900))
Code Block:
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com/");
driver.manage().window().setSize(new Dimension(1440, 900));
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(".\\Screenshots\\using-setSize.png"));
driver.quit();
Browser Snapshot:
tl; dr
You can find Selenium python client based discussion on maximizing window in Selenium Firefox headless returns different results
I'm using chromedriver 2.30 & chrome browser v60 through protractor. I run the tests headless too albeit I don't do it via chromeoptions. Rather I run tests headless using xvfb-run on a unix distribution. I'm encountering this issue also albeit it fails randomly for me. See stack below
[chrome #11] [31mWebDriverError: unknown error: failed to change window state to maximized, current state is normal
[chrome #11] (Session info: chrome=60.0.3112.78)
[chrome #11] (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 3.10.0-514.26.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
[chrome #11] Command duration or timeout: 122 milliseconds
[chrome #11] Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
[chrome #11] System info: host: 's1wfadvcilvm08', ip: '172.16.184.183', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.26.2.el7.x86_64', java.version: '1.8.0_141'
[chrome #11] Driver info: org.openqa.selenium.chrome.ChromeDriver
[chrome #11] Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57), userDataDir=/tmp/.org.chromium.Chromium.BNsN1w}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=60.0.3112.78, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
My code at the beginning of each test does the following
browser.manage().window().maximize();
changing to
driver.driver.manage().window().maximize();
driver.manage().window().maximize();
doesn't work for me either unfortunately. Shouldn't browser.manage().window().maximize() be still working as I'm running headless using xvfb-run rather than doing headless via chrome options?
This bug was initially fixed in ChromeDriver 2.42, and was actual for macOS until 2.44 (check changelogs: http://chromedriver.chromium.org/downloads).
So there is a solution for everyone who faces this issue: update your driver version
This is known issue on Ubuntu 20.04 LTS for headless Google Chrome. I just used Java's awt pakage to get maximum resolution of whatevevr screen i.e. xvbf for Ubuntu LTS and current screen for Windows 10 and set it in arggument of ChromeOption to configure Webdriver
java.awt.Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
chromeOptions.addArguments("--window-size=" + (int) screenDimension.getWidth() + "," + (int) screenDimension.getHeight());
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']
}
}
I am trying to run some automated tests on Jenkins using protractor which uses selenium and chromedriver.
I have also setup xvfb so that we can run these tests in a headless manner. I have the xvfb jenkins plugin installed and it is working correctly.
Error
The problem I'm having, is when I start the tests, chrome keeps crashing. I get this error:
E/launcher - WebDriverError: unknown error: Chrome failed to start: crashed
...
E/launcher - Process exited with error code 199
Setup
Here is the information I have on the setup of the system:
Chrome
Location: /usr/bin/google-chrome
Version: Chromium 52.0.2743.0
ChromeDriver
Location: {project_home}/src/js/node_modules/webdriver-manager/selenium/chromedriver_2.24
Version: ChromeDriver 2.24.417424
Selenium
Location: {project_home}/src/js/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar
Version: 2.53.1
Protractor
Location: {project_home}/src/js/node_modules/protractor
Version: 4.0.9
WebDriver Manager
Location: {project_home}/src/js/node_modules/webdriver-manager
Version: 10.2.4
Jenkins
Version: 1.6.17
xvfb
Version: Unknown
Node
Version: 6.7
Java
Version: java-8-openjdk-amd64
Output
Here is the console output from Jenkins:
...
21:58:07.380 INFO - Launching a standalone Selenium Server
21:58:07.407 INFO - Java: Oracle Corporation 25.111-b14
21:58:07.407 INFO - OS: Linux 4.4.0-47-generic amd64
21:58:07.418 INFO - v2.53.1, with Core v2.53.1. Built from revision a36b8b1
21:58:07.473 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
21:58:07.474 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
21:58:07.474 INFO - Driver class not found: com.opera.core.systems.OperaDriver
21:58:07.474 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
21:58:07.475 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
21:58:07.475 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUnitDriver
21:58:07.475 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
21:58:07.527 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
21:58:07.527 INFO - Selenium Server is up and running
Current webdriver status: [21:58:08] I/status - selenium standalone version available: 2.53.1 [default]
[21:58:08] I/status - chromedriver versions available: 2.22, 2.24 [default]
[21:58:08] I/status - geckodriver version available: v0.9.0 [default]
[21:58:08] I/status - android-sdk is not present
[21:58:08] I/status - appium is not present
**** STARTING GUI TESTS ****
Running ./node_modules/protractor/bin/protractor conf-server.js
[21:58:08] I/local - Starting selenium standalone server...
[21:58:08] I/launcher - Running 1 instances of WebDriver
[21:58:09] I/local - Selenium standalone server started at http://10.0.0.82:33509/wd/hub
[21:59:09] E/launcher - unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 4.4.0-47-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.17 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'ip-10-0-0-82', ip: '10.0.0.82', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-47-generic', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
[21:59:09] E/launcher - WebDriverError: unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 4.4.0-47-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.17 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'ip-10-0-0-82', ip: '10.0.0.82', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-47-generic', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at WebDriverError ({project_home}/src/js/node_modules/selenium-webdriver/lib/error.js:27:5)
at Object.checkLegacyResponse ({project_home}/src/js/node_modules/selenium-webdriver/lib/error.js:639:15)
at parseHttpResponse ({project_home}/src/js/node_modules/selenium-webdriver/http/index.js:538:13)
at client_.send.then.response ({project_home}/src/js/node_modules/selenium-webdriver/http/index.js:472:11)
at ManagedPromise.invokeCallback_ ({project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ ({project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ ({project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at asyncRun ({project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:2820:25)
at {project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
at Function.createSession ({project_home}/src/js/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
at Builder.build ({project_home}/src/js/node_modules/selenium-webdriver/builder.js:458:24)
at Local.DriverProvider.getNewDriver ({project_home}/src/js/node_modules/protractor/built/driverProviders/driverProvider.js:37:33)
at Runner.createBrowser ({project_home}/src/js/node_modules/protractor/built/runner.js:198:43)
at {project_home}/src/js/node_modules/protractor/built/runner.js:277:30
at _fulfilled ({project_home}/src/js/node_modules/q/q.js:834:54)
at self.promiseDispatch.done ({project_home}/src/js/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch ({project_home}/src/js/node_modules/q/q.js:796:13)
at {project_home}/src/js/node_modules/q/q.js:604:44
at runSingle ({project_home}/src/js/node_modules/q/q.js:137:13)
[21:59:09] E/launcher - Process exited with error code 199
Protractor Config
exports.config = {
seleniumServerJar: './node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar',
chromeDriver: './node_modules/webdriver-manager/selenium/chromedriver_2.24',
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
binary: '/usr/bin/google-chrome',
args: ['--enable-logging','--v=1'],
extensions: []
}
},
framework: 'custom',
frameworkPath: require.resolve('./node_modules/protractor-cucumber-framework'),
specs: [
'../../features/gui/active/*.feature'
],
onPrepare: function ()
{
require('babel-register')({ presets : ['es2015'] })
}
};
Jenkins xvfb plugin
Related
Chrome reference: https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start
unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.9 suggests configuring xvfb
WebDriverError: unknown error: Chrome failed to start: exited abnormally unsolved
https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/8409 suggests using direct connect: "Protractor can test directly against Chrome and Firefox without using a Selenium Server. To use this, in your config file set directConnect: true."
Selenium Webdriver & Chrome driver - not able to run chrome driver suggests using java 1.6 instead
Chrome on remote webdriver (via Grid) failed to start suggests using x64 chromedriver and specifying it in a parameter
Please try updating Protractor to latest 4.0.11 and chrome driver to 2.25 as there were lot of issues reported in 2.24 version which has been fixed.
Try it once and let us know.
Can you follow below :
- In you jenkins settings add a global property
key : DISPLAY
value:0:0
- On your server start Xvfb in the background:
Xvfb :0 -ac -screen 0 1024x768x24 &
Reference link:
unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.9
I had the same issue as you
I ended up to change my args as a below
args: [ "--headless", "--no-sandbox" ,"--disable-dev-shm-usage"]