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.
Related
Starting ChromeDriver 80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987#{#882}) on port 37201
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 80
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'DELL', ip: '192.168.43.201', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_221'
Driver info: driver.version: ChromeDriver
remote stacktrace: Backtrace:Ordinal0 [0x01510C83+1707139]
Ordinal0 [0x014768F1+1075441]
Ordinal0 [0x013EDFC9+516041]
Ordinal0 [0x01380554+66900]
The version of google chrome browser on your system should be same as your chrome driver version.
Goto Google Chrome -> Help -> About Google Chrome to check chrome version.
Then download the same version chromedriver from here: https://chromedriver.chromium.org/downloads
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());
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"]
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.
I'm writing a Selenium script in Java. I've a website say originalwebsite.com, and when enter this and hit a go, it will go to authenticationwebsite.com, authenticate the credentials and auto redirect to originalwebsite.com.
I'm sorry that I can't reveal the origianlwebsite and authenticationwebsite URLs sine these are our Organisation's.
When I enter it directly in any Chrome browser, this is done automatically, since the authenticationwebsite credentials are stored.
But when i do it through Selenium, instead of redirecting to originalwebsite.com, the process stops at authenticationwebsite.com and asks for credentials. Going through some forums in SO, I've tried the below code.
In Chrome
System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");
String user = System.getProperty("user.name");
// System.out.println(user);
ChromeOptions options = new ChromeOptions();
options.addArguments(
"user-data-dir=C:/Users/" + user.toUpperCase() + "/AppData/Local/Google/Chrome/User Data/Default");
options.addArguments("--start-maximized");
WebDriver cd = new ChromeDriver(options);
cd.get("https://originalwebsite.com");
When I run this i get the below Exception.
Starting ChromeDriver 2.19.346078 (6f1f0cde889532d48ce8242342d0b84f94b114a1) on port 9702
Only local connections are allowed.
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.19.346078 (6f1f0cde889532d48ce8242342d0b84f94b114a1),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 61.39 seconds
Build info: version: '2.48.1', revision: 'd80083d', time: '2015-10-08 21:07:25'
System info: host: 'U0138039-TPD-A', ip: '10.112.78.15', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_67'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:148)
at EaselTest.main(EaselTest.java:21)
But in Firefox, this is working fine. And the code that i've used is as below.
ProfilesIni profile = new ProfilesIni();
FirefoxProfile ffprofile = profile.getProfile("default");
WebDriver cd = new FirefoxDriver(ffprofile);
cd.get("https://originalwebsite.com");
Please let me know how can i do it in Chrome, since most of the users here use chrome as their default browser.
Thanks
Seems like selenium is failing to pick up chrome browser where it is installed.
Check this answer : ChromeWebDriver - unknown error: Chrome failed to start: crashed