Selenium Chrome driver and Travis CI don't work together
up vote
1
down vote
favorite
When Travis builds my application and comes to Selenium tests, it throws the following message in the log:
Only local connections are allowed.
and then tests fail with org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
exception
.travis.yml:
language: java
jdk:
- openjdk8
sudo: required
dist: trusty
addons: # get google-chrome-stable
chrome: stable
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3
install:
- wget -N http://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
and then
System.setProperty("webdriver.chrome.driver", "/usr/local/share/chromedriver");
webDriver = new ChromeDriver();
Dependency
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>
I feel like it's something about Travis configuration. My application is web-based(Spring), so It has to be working in order to be tested.
What should I do so that Selenium tests with Chrome driver will be able to work on Travis CI?
So far, I've seen many ways of solving the problem but none of them worked. I feel like it's impossible. Why is this that problematic?
Updated.
An attempt, as @LucasTierney told, to remove - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
didn't do any changes.
Updated
Well, finally it began to work with the same config above. I don't know what happend and why it didn't work earlier.
java spring selenium travis-ci
|
show 4 more comments
up vote
1
down vote
favorite
When Travis builds my application and comes to Selenium tests, it throws the following message in the log:
Only local connections are allowed.
and then tests fail with org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
exception
.travis.yml:
language: java
jdk:
- openjdk8
sudo: required
dist: trusty
addons: # get google-chrome-stable
chrome: stable
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3
install:
- wget -N http://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
and then
System.setProperty("webdriver.chrome.driver", "/usr/local/share/chromedriver");
webDriver = new ChromeDriver();
Dependency
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>
I feel like it's something about Travis configuration. My application is web-based(Spring), so It has to be working in order to be tested.
What should I do so that Selenium tests with Chrome driver will be able to work on Travis CI?
So far, I've seen many ways of solving the problem but none of them worked. I feel like it's impossible. Why is this that problematic?
Updated.
An attempt, as @LucasTierney told, to remove - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
didn't do any changes.
Updated
Well, finally it began to work with the same config above. I don't know what happend and why it didn't work earlier.
java spring selenium travis-ci
Have a look at stackoverflow.com/questions/38846079/…
– Balwinder Singh
Nov 9 at 5:34
@BalwinderSingh didn't help. The thing is that I face this issue only when I use Travis but not when I do testing on my local machine
– THE Waterfall
Nov 9 at 6:49
"Only local connections are allowed" is expected
– Corey Goldberg
Nov 9 at 16:01
@CoreyGoldberg what's the issue there? Looks like I did everything as supposed to be
– THE Waterfall
Nov 9 at 17:58
why are you starting a browser in the before_install step?
– Corey Goldberg
Nov 9 at 20:05
|
show 4 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
When Travis builds my application and comes to Selenium tests, it throws the following message in the log:
Only local connections are allowed.
and then tests fail with org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
exception
.travis.yml:
language: java
jdk:
- openjdk8
sudo: required
dist: trusty
addons: # get google-chrome-stable
chrome: stable
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3
install:
- wget -N http://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
and then
System.setProperty("webdriver.chrome.driver", "/usr/local/share/chromedriver");
webDriver = new ChromeDriver();
Dependency
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>
I feel like it's something about Travis configuration. My application is web-based(Spring), so It has to be working in order to be tested.
What should I do so that Selenium tests with Chrome driver will be able to work on Travis CI?
So far, I've seen many ways of solving the problem but none of them worked. I feel like it's impossible. Why is this that problematic?
Updated.
An attempt, as @LucasTierney told, to remove - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
didn't do any changes.
Updated
Well, finally it began to work with the same config above. I don't know what happend and why it didn't work earlier.
java spring selenium travis-ci
When Travis builds my application and comes to Selenium tests, it throws the following message in the log:
Only local connections are allowed.
and then tests fail with org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
exception
.travis.yml:
language: java
jdk:
- openjdk8
sudo: required
dist: trusty
addons: # get google-chrome-stable
chrome: stable
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3
install:
- wget -N http://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
and then
System.setProperty("webdriver.chrome.driver", "/usr/local/share/chromedriver");
webDriver = new ChromeDriver();
Dependency
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>
I feel like it's something about Travis configuration. My application is web-based(Spring), so It has to be working in order to be tested.
What should I do so that Selenium tests with Chrome driver will be able to work on Travis CI?
So far, I've seen many ways of solving the problem but none of them worked. I feel like it's impossible. Why is this that problematic?
Updated.
An attempt, as @LucasTierney told, to remove - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
didn't do any changes.
Updated
Well, finally it began to work with the same config above. I don't know what happend and why it didn't work earlier.
java spring selenium travis-ci
java spring selenium travis-ci
edited Nov 12 at 7:41
asked Nov 9 at 5:21
THE Waterfall
8416
8416
Have a look at stackoverflow.com/questions/38846079/…
– Balwinder Singh
Nov 9 at 5:34
@BalwinderSingh didn't help. The thing is that I face this issue only when I use Travis but not when I do testing on my local machine
– THE Waterfall
Nov 9 at 6:49
"Only local connections are allowed" is expected
– Corey Goldberg
Nov 9 at 16:01
@CoreyGoldberg what's the issue there? Looks like I did everything as supposed to be
– THE Waterfall
Nov 9 at 17:58
why are you starting a browser in the before_install step?
– Corey Goldberg
Nov 9 at 20:05
|
show 4 more comments
Have a look at stackoverflow.com/questions/38846079/…
– Balwinder Singh
Nov 9 at 5:34
@BalwinderSingh didn't help. The thing is that I face this issue only when I use Travis but not when I do testing on my local machine
– THE Waterfall
Nov 9 at 6:49
"Only local connections are allowed" is expected
– Corey Goldberg
Nov 9 at 16:01
@CoreyGoldberg what's the issue there? Looks like I did everything as supposed to be
– THE Waterfall
Nov 9 at 17:58
why are you starting a browser in the before_install step?
– Corey Goldberg
Nov 9 at 20:05
Have a look at stackoverflow.com/questions/38846079/…
– Balwinder Singh
Nov 9 at 5:34
Have a look at stackoverflow.com/questions/38846079/…
– Balwinder Singh
Nov 9 at 5:34
@BalwinderSingh didn't help. The thing is that I face this issue only when I use Travis but not when I do testing on my local machine
– THE Waterfall
Nov 9 at 6:49
@BalwinderSingh didn't help. The thing is that I face this issue only when I use Travis but not when I do testing on my local machine
– THE Waterfall
Nov 9 at 6:49
"Only local connections are allowed" is expected
– Corey Goldberg
Nov 9 at 16:01
"Only local connections are allowed" is expected
– Corey Goldberg
Nov 9 at 16:01
@CoreyGoldberg what's the issue there? Looks like I did everything as supposed to be
– THE Waterfall
Nov 9 at 17:58
@CoreyGoldberg what's the issue there? Looks like I did everything as supposed to be
– THE Waterfall
Nov 9 at 17:58
why are you starting a browser in the before_install step?
– Corey Goldberg
Nov 9 at 20:05
why are you starting a browser in the before_install step?
– Corey Goldberg
Nov 9 at 20:05
|
show 4 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
You are using a chromedriver version that is too old. 2.30
only supports (officially) v58-60
. If you're going to use the latest stable (currently 70
), as you're installing, you should use a chromedriver that supports it. That would be 2.42
or greater
My mistake I didn't mention but I already tried to use the newest chromedriver version. Unfortunately, the result was still the same.
– THE Waterfall
Nov 9 at 13:44
Why are you starting the chrome browser before running your tests? This will cause issues ` - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 localhost &`
– Lucas Tierney
Nov 9 at 13:46
What do you mean? But how would I be able to test without a started browser If Selenium requires browser?
– THE Waterfall
Nov 9 at 13:51
Selenium starts the browser for you, it cannot connect to a browser already running
– Lucas Tierney
Nov 9 at 13:52
Well, I commented this- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
but the same issue remained
– THE Waterfall
Nov 9 at 13:57
|
show 7 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
You are using a chromedriver version that is too old. 2.30
only supports (officially) v58-60
. If you're going to use the latest stable (currently 70
), as you're installing, you should use a chromedriver that supports it. That would be 2.42
or greater
My mistake I didn't mention but I already tried to use the newest chromedriver version. Unfortunately, the result was still the same.
– THE Waterfall
Nov 9 at 13:44
Why are you starting the chrome browser before running your tests? This will cause issues ` - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 localhost &`
– Lucas Tierney
Nov 9 at 13:46
What do you mean? But how would I be able to test without a started browser If Selenium requires browser?
– THE Waterfall
Nov 9 at 13:51
Selenium starts the browser for you, it cannot connect to a browser already running
– Lucas Tierney
Nov 9 at 13:52
Well, I commented this- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
but the same issue remained
– THE Waterfall
Nov 9 at 13:57
|
show 7 more comments
up vote
0
down vote
accepted
You are using a chromedriver version that is too old. 2.30
only supports (officially) v58-60
. If you're going to use the latest stable (currently 70
), as you're installing, you should use a chromedriver that supports it. That would be 2.42
or greater
My mistake I didn't mention but I already tried to use the newest chromedriver version. Unfortunately, the result was still the same.
– THE Waterfall
Nov 9 at 13:44
Why are you starting the chrome browser before running your tests? This will cause issues ` - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 localhost &`
– Lucas Tierney
Nov 9 at 13:46
What do you mean? But how would I be able to test without a started browser If Selenium requires browser?
– THE Waterfall
Nov 9 at 13:51
Selenium starts the browser for you, it cannot connect to a browser already running
– Lucas Tierney
Nov 9 at 13:52
Well, I commented this- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
but the same issue remained
– THE Waterfall
Nov 9 at 13:57
|
show 7 more comments
up vote
0
down vote
accepted
up vote
0
down vote
accepted
You are using a chromedriver version that is too old. 2.30
only supports (officially) v58-60
. If you're going to use the latest stable (currently 70
), as you're installing, you should use a chromedriver that supports it. That would be 2.42
or greater
You are using a chromedriver version that is too old. 2.30
only supports (officially) v58-60
. If you're going to use the latest stable (currently 70
), as you're installing, you should use a chromedriver that supports it. That would be 2.42
or greater
answered Nov 9 at 13:38
Lucas Tierney
1,52278
1,52278
My mistake I didn't mention but I already tried to use the newest chromedriver version. Unfortunately, the result was still the same.
– THE Waterfall
Nov 9 at 13:44
Why are you starting the chrome browser before running your tests? This will cause issues ` - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 localhost &`
– Lucas Tierney
Nov 9 at 13:46
What do you mean? But how would I be able to test without a started browser If Selenium requires browser?
– THE Waterfall
Nov 9 at 13:51
Selenium starts the browser for you, it cannot connect to a browser already running
– Lucas Tierney
Nov 9 at 13:52
Well, I commented this- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
but the same issue remained
– THE Waterfall
Nov 9 at 13:57
|
show 7 more comments
My mistake I didn't mention but I already tried to use the newest chromedriver version. Unfortunately, the result was still the same.
– THE Waterfall
Nov 9 at 13:44
Why are you starting the chrome browser before running your tests? This will cause issues ` - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 localhost &`
– Lucas Tierney
Nov 9 at 13:46
What do you mean? But how would I be able to test without a started browser If Selenium requires browser?
– THE Waterfall
Nov 9 at 13:51
Selenium starts the browser for you, it cannot connect to a browser already running
– Lucas Tierney
Nov 9 at 13:52
Well, I commented this- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
but the same issue remained
– THE Waterfall
Nov 9 at 13:57
My mistake I didn't mention but I already tried to use the newest chromedriver version. Unfortunately, the result was still the same.
– THE Waterfall
Nov 9 at 13:44
My mistake I didn't mention but I already tried to use the newest chromedriver version. Unfortunately, the result was still the same.
– THE Waterfall
Nov 9 at 13:44
Why are you starting the chrome browser before running your tests? This will cause issues ` - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 localhost &`
– Lucas Tierney
Nov 9 at 13:46
Why are you starting the chrome browser before running your tests? This will cause issues ` - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 localhost &`
– Lucas Tierney
Nov 9 at 13:46
What do you mean? But how would I be able to test without a started browser If Selenium requires browser?
– THE Waterfall
Nov 9 at 13:51
What do you mean? But how would I be able to test without a started browser If Selenium requires browser?
– THE Waterfall
Nov 9 at 13:51
Selenium starts the browser for you, it cannot connect to a browser already running
– Lucas Tierney
Nov 9 at 13:52
Selenium starts the browser for you, it cannot connect to a browser already running
– Lucas Tierney
Nov 9 at 13:52
Well, I commented this
- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
but the same issue remained– THE Waterfall
Nov 9 at 13:57
Well, I commented this
- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=80 http://localhost &
but the same issue remained– THE Waterfall
Nov 9 at 13:57
|
show 7 more comments
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53220276%2fselenium-chrome-driver-and-travis-ci-dont-work-together%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have a look at stackoverflow.com/questions/38846079/…
– Balwinder Singh
Nov 9 at 5:34
@BalwinderSingh didn't help. The thing is that I face this issue only when I use Travis but not when I do testing on my local machine
– THE Waterfall
Nov 9 at 6:49
"Only local connections are allowed" is expected
– Corey Goldberg
Nov 9 at 16:01
@CoreyGoldberg what's the issue there? Looks like I did everything as supposed to be
– THE Waterfall
Nov 9 at 17:58
why are you starting a browser in the before_install step?
– Corey Goldberg
Nov 9 at 20:05