I'm trying to set up webdriver test (with firefoxdriver) in hudson.
In my ant file, I start "vncserver :1" firstly and then start my test by passing
〈env key="DISPLAY" value=":1" /〉
to my test case.
I can run this in a terminal with sudo. However when I start the job in hudson (running with root), I always got:
org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.18-128.1.14.el5a02xen', java.version: '1.6.0_31'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:92)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:71)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:85)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:121)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:77)
at amazon.dropship.selfservice.test.WebTesterImpl.(WebTesterImpl.java:38)
at amazon.dropship.selfservice.test.WebTesterImpl.getInstance(WebTesterImpl.java:48)
at amazon.dropship.selfservice.test.DSCentralTestBase.setUp(DSCentralTestBase.java:39)
at amazon.dropship.selfservice.test.smoke.ReadOnlyTests.setUp(ReadOnlyTests.java:11)
I forgot to add the environment variables:
HOME =/root
USER = root
That was all. Thanks for looking at this
Related
i just try to run my 1st protractor so i just get the code from here
and i code in eclipse and i convert tern project as well and then i cd to my project then i type this code
protractor conf.js
then i got this error
(node:9552) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[10:17:07] I/launcher - Running 1 instances of WebDriver
[10:17:07] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[10:17:07] 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=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-29-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 63 milliseconds
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:19.891Z'
System info: host: 'groot', ip: '192.168.2.8', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-29-generic', java.version: '1.8.0_171'
Driver info: driver.version: unknown
[10:17:07] 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=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-29-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 63 milliseconds
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:19.891Z'
System info: host: 'groot', ip: '192.168.2.8', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-29-generic', java.version: '1.8.0_171'
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 <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: WebDriver.createSession()
at Function.createSession (/usr/local/lib/node_modules/protractor/node_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 Hosted.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 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)
[10:17:07] E/launcher - Process exited with error code 199
note : web driver is running and i have chrome Version 67.0.3396.87 (Official Build) (64-bit)
and my os is ubuntu how can i fix this? thank you for your time
Try adding the chrome option --no-sandbox in your config
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['--no-sandbox']
}
},
Please help me to resolve problem with Selenium and ChromeDriver. I have problem when using MacOS
eclipse Oxygen
java 1.8
selenium 3.9.1
chromedriver 2.35
the message is:
Starting ChromeDriver 2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef) on port 25267
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception
from disconnected: unable to connect to renderer
(Session info: chrome=64.0.3282.186)
(Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.13.2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 527 milliseconds
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:22.379Z'
System info: host: 'S-MIS-DAILV-2.local', ip: 'fe80:0:0:0:4f0:884f:5322:f47f%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.2', java.version: '1.8.0_162'
Driver info: driver.version: ChromeDriver
Thank so much for view this question.
Tests fail sporadically with the error of "Chrome not reachable".
Throwing a WebDriver exception: chrome not reachable
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.26 seconds
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z'
System info: host: 'XXXXXXXX', ip: 'XXXXXXXXX', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_144'
Driver info: driver.version: Driver
Exception : org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z'
System info: host: 'XXXXXXXX', ip: 'XXXXXXXXX', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_144'
Driver info: driver.version: Driver
[ERROR] Driver Initialize - Error initializing driver for browser 'CHROME'. chrome not reachable
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.26 seconds
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z'
System info: host: 'XXXXXXXXXX', ip: 'XXXXXXXXX', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_144'
Driver info: driver.version: Driver
org.openqa.selenium.WebDriverException: chrome not reachable
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.26 seconds
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z'
System info: host: 'XXXXXXXX', ip: 'XXXXXXXXX', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_144'
Driver info: driver.version: Driver
When I do some logging I see the error is with the DevTools request failing. This happens sporadically. It looks like chromedriver creates a new port for debugging for each test and sometimes Chromedriver can't connect to the new port. Not sure why and don't know how to fix it. Anyone experience this?
[1516896066.375][INFO]: Launching chrome: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-automation --enable-logging --force-fieldtrials=SiteIsolationExtensions/Control --ignore-certificate-errors --load-extension="C:\Users\mna7158\AppData\Local\Temp\scoped_dir6732_10840\internal" --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12923 --test-type=webdriver --use-mock-keychain --user-data-dir="C:\Users\mna7158\AppData\Local\Temp\scoped_dir6732_15347" data:,
[1516896066.431][DEBUG]: DevTools request: http://localhost:12923/json/version
[1516896068.429][DEBUG]: DevTools request failed
[1516896068.480][DEBUG]: DevTools request: http://localhost:12923/json/version
[1516896068.688][DEBUG]: DevTools request failed
[1516896068.739][DEBUG]: DevTools request: http://localhost:12923/json/version
[1516896070.481][DEBUG]: DevTools request failed
[1516896070.532][DEBUG]: DevTools request: http://localhost:12923/json/version
[1516896070.742][DEBUG]: DevTools request failed
[1516896070.793][DEBUG]: DevTools request: http://localhost:12923/json/version
[1516896072.532][DEBUG]: DevTools request failed
Specifications:
Chrome version 64 (64 bit)
OS = Windows 7
Chromedriver 2.35
Selenium-Java 3.7.1
Sample code that I get this error with.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class chromeDriverExample {
public WebDriver driver;
WebDriverWait wait;
#BeforeMethod
public void beforeMethod() {
System.setProperty("webdriver.chrome.driver", "src//test//resources//drivers//chromedriver.exe");
System.setProperty("webdriver.chrome.verboseLogging", "true");
driver = new ChromeDriver();
wait = new WebDriverWait(driver, 30);
}
#AfterMethod
public void afterMethod() {
driver.close();
driver.quit();
}
#Test(invocationCount = 15)
public void chromeTest() {
driver.get("https://google.com");
wait.until(ExpectedConditions.presenceOfElementLocated(By.name("q")));
}
}
This may or may not be related but I am seeing something similar. Since my local Chrome auto updated (macOS) to v64 we are seeing quite sporadic Selenium TimeoutExceptions. If I fudge my Chrome version and pin it at version 63, this doesn't happen. Something has been broken or changed in v64, but i'm struggling to pin what. I don't know if a new ChromeDriver is imminent and will fix it though.
I've been searching and trying different solutions for almost a week, but still not find the answer.
First off, my environment:
Server Debian 8 (no-GUI), Protractor 4.0.9, Selenium Server 2.53.1 (started using webdriver-manager), Chromedriver 2.24.417424, Chrome 54.0.2840.100, Firefox 43.0, Xvfb
I'm trying to use headless Chrome to execute my tests but Chrome is never able to start.
Notice that I'm able to run my tests using Firefox headless perfectly fine.
This my output when trying to run a test using Chrome:
[18:38:31] E/launcher - unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.16.0-4-amd64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.13 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'testing', ip: '10.128.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-4-amd64', java.version: '1.7.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
[18:38:31] E/launcher - WebDriverError: unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.16.0-4-amd64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.13 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'testing', ip: '10.128.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-4-amd64', java.version: '1.7.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at WebDriverError (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
at Object.checkLegacyResponse (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:639:15)
at parseHttpResponse (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:538:13)
at client_.send.then.response (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11)
at ManagedPromise.invokeCallback_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at asyncRun (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25)
at /usr/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 Function.createSession (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
at Builder.build (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:458:24)
at Hosted.DriverProvider.getNewDriver (/usr/lib/node_modules/protractor/built/driverProviders/driverProvider.js:37:33)
at Runner.createBrowser (/usr/lib/node_modules/protractor/built/runner.js:198:43)
at /usr/lib/node_modules/protractor/built/runner.js:277:30
at _fulfilled (/usr/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/usr/lib/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/usr/lib/node_modules/protractor/node_modules/q/q.js:796:13)
at /usr/lib/node_modules/protractor/node_modules/q/q.js:556:49
at runSingle (/usr/lib/node_modules/protractor/node_modules/q/q.js:137:13)
[18:38:31] E/launcher - Process exited with error code 199
It is always the same.
I'm able to run both Chrome and Firefox using Xvfb normally, and chromedriver runs fine when started manually.
This is the command I use to start Xvfb:
Xvfb -ac :99 -screen 0 1280x1024x16 &
export DISPLAY=:99
Output when starting chromedriver manually:
Starting ChromeDriver 2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3) on port 9515
Only local connections are allowed.
Hope you guys can help me.
You need to start your protractor process using the command xvbf-run protractor configuration.js
I'm having trouble launching Cucumber test with Chrome using remote webdriver capabilities on Grid (1 linux hub and 1 linux node with Firefox and Chrome). Firefox test go very well but Chrome returns the following error:
unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.2,platform=Linux 3.2.0-23-generic-pae x86) (WARNING: The server did not provide any stacktrace information)
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Command duration or timeout: 20.67 seconds
Build info: version: '2.30.0', revision: 'dc1ef9c', time: '2013-02-19 00:15:27'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.2.0-23-generic-pae', java.version: '1.7.0_25'
Driver info: org.openqa.selenium.chrome.ChromeDriver (org.openqa.selenium.WebDriverException) (Selenium::WebDriver::Error::UnknownError)
The browser is initialized as:
$profile = Selenium::WebDriver::Chrome::Profile.new
$profile['download.prompt_for_download'] = false
$profile['download.default_directory'] = downloads_path
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
platform: "Linux",
version: "",
"chrome.profile" => $profile)
browser = Watir::Browser.new(
:remote,
:url => 'http://aut.theurl.net:4444/wd/hub',
:desired_capabilities => capabilities)
More information:
I tried chromedriver versions 2.3 and 2.2 and selenium-server-standalone 2.35 and 2.3 unsuccessfully.
Though terminal, chromedriver starts successfully, so paths seems to be ok.
It seems that Chrome starts on the remote node but immediately fails. I'm a little out of ideas, so any thought or guidance is welcome.
Thanks in advance!
===================================
UPDATE: added more console log information. Maybe there were more information here but I can't see anything valuable.
11:45:47.612 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.35.0', revision: 'c916b9d', time: '2013-08-12 15:42:01'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.2.0-23-generic-pae', java.version: '1.7.0_25'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
(...)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.35.0', revision: 'c916b9d', time: '2013-08-12 15:42:01'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.2.0-23-generic-pae', java.version: '1.7.0_25'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:72)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:56)
(...)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:62)
... 9 more
Caused by: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.2,platform=Linux 3.2.0-23-generic-pae x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 20.53 seconds
Build info: version: '2.35.0', revision: 'c916b9d', time: '2013-08-12 15:42:01'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.2.0-23-generic-pae', java.version: '1.7.0_25'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
(...)
11:45:47.612 WARN - Exception: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.2,platform=Linux 3.2.0-23-generic-pae x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 20.53 seconds
Build info: version: '2.35.0', revision: 'c916b9d', time: '2013-08-12 15:42:01'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.2.0-23-generic-pae', java.version: '1.7.0_25'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Finally, it works!
I changed two things:
use a different chromedriver (linux64 instead of linux32)
include the chromedriver path on the command using Dwebdriver.chrome.driver switch:
java -jar ./selenium-server-standalone-2.35.0.jar - Dwebdriver.chrome.driver='/opt/drivers/chromedriver' -role webdriver -hub http://192.168.1.10:4444/grid/register -port 5566 -browser browserName=chrome,maxInstances=5,platform=LINUX &
Thank you very much for your reference :)