2017-05-23 1 views
0

J'essaie d'exécuter un test Selenium sur un serveur bamboo, en utilisant Xvfb pour simuler un affichage.selenium UnreachableBrowserException

Les tests fonctionnent avec ChromeDriver et PhantomJS, mais il s'écrasent avec Firefox:

Forking command line: /bin/sh -c cd /usr/local/bamboo/BAMBOO/xml-data/build-dir/SL-SL-JOB1 && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -jar /usr/local/bamboo/BAMBOO/xml-data/build-dir/SL-SL-JOB1/target/surefire/surefirebooter1260921380504465598.jar /usr/local/bamboo/BAMBOO/xml-data/build-dir/SL-SL-JOB1/target/surefire/surefire4923082243141341705tmp /usr/local/bamboo/BAMBOO/xml-data/build-dir/SL-SL-JOB1/target/surefire/surefire_04348841300974089213tmp 
Running com.lazerycode.selenium.tests.GoogleExampleIT 
Configuring TestNG with: TestNG60Configurator 

Current Operating System: LINUX 
Current Architecture: amd64 
Current Browser Selection: FIREFOX 

1495535703540  geckodriver  INFO  Listening on 127.0.0.1:17068 
1495535704705  geckodriver::marionette  INFO  Starting browser /usr/lib/firefox/firefox.sh with args ["-marionette"] 
1495535709415  Marionette  INFO  Listening on port 39935 
1495535709539  Marionette  WARN  TLS certificate errors will be ignored for this session 
mai 23, 2017 12:35:10 PM org.openqa.selenium.remote.ProtocolHandshake createSession 
INFOS: Detected dialect: W3C 
mai 23, 2017 12:35:12 PM org.openqa.selenium.os.UnixProcess destroy 
INFOS: Command failed to close cleanly. Destroying forcefully (v2). [/usr/local/bamboo/BAMBOO/xml-data/build-dir/SL-SL-JOB1/src/test/resources/selenium_standalone_binaries/linux/marionette/64bit/geckodriver, --port=17068][ {}] 
mai 23, 2017 12:35:13 PM org.openqa.selenium.os.UnixProcess destroy 
GRAVE: Unable to kill process with PID 4042 
Tests run: 5, Failures: 2, Errors: 0, Skipped: 3, Time elapsed: 11.775 sec <<< FAILURE! - in com.lazerycode.selenium.tests.GoogleExampleIT 
setup(com.lazerycode.selenium.tests.GoogleExampleIT) Time elapsed: 11.021 sec <<< FAILURE! 
org.openqa.selenium.remote.UnreachableBrowserException: 
Error communicating with the remote browser. It may have died. 
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown' 
System info: host: 'vps409374', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-78-generic', java.version: '1.8.0_131' 
Driver info: driver.version: RemoteWebDriver 
Capabilities [{moz:profile=/tmp/rust_mozprofile.3cTlgJI5I9iE, rotatable=false, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0.0, moz:accessibilityChecks=false, acceptInsecureCerts=true, browserVersion=53.0.2, platformVersion=4.4.0-78-generic, moz:processID=4050.0, browserName=firefox, javascriptEnabled=true, platformName=linux}] 
Session ID: 329b5087-5597-478b-9dac-6472c5490aee 
    at com.lazerycode.selenium.tests.GoogleExampleIT.setup(GoogleExampleIT.java:21) 
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:17068 [localhost/127.0.0.1] failed: Connection refused (Connection refused) 
    at com.lazerycode.selenium.tests.GoogleExampleIT.setup(GoogleExampleIT.java:21) 
Caused by: java.net.ConnectException: Connection refused (Connection refused) 
    at com.lazerycode.selenium.tests.GoogleExampleIT.setup(GoogleExampleIT.java:21) 

closeDriverObjects(com.lazerycode.selenium.tests.GoogleExampleIT) Time elapsed: 11.605 sec <<< FAILURE! 
org.openqa.selenium.remote.UnreachableBrowserException: 
Error communicating with the remote browser. It may have died. 
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown' 
System info: host: 'vps409374', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-78-generic', java.version: '1.8.0_131' 
Driver info: driver.version: RemoteWebDriver 
Capabilities [{moz:profile=/tmp/rust_mozprofile.3cTlgJI5I9iE, rotatable=false, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0.0, moz:accessibilityChecks=false, acceptInsecureCerts=true, browserVersion=53.0.2, platformVersion=4.4.0-78-generic, moz:processID=4050.0, browserName=firefox, javascriptEnabled=true, platformName=linux}] 
Session ID: 329b5087-5597-478b-9dac-6472c5490aee 
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:17068 [localhost/127.0.0.1] failed: Connection refused (Connection refused) 
Caused by: java.net.ConnectException: Connection refused (Connection refused) 


Results : 

Failed tests: 
    GoogleExampleIT>DriverBase.closeDriverObjects:43 » UnreachableBrowser Error co... 
    GoogleExampleIT.setup:21 » UnreachableBrowser Error communicating with the rem... 

Tests run: 5, Failures: 2, Errors: 0, Skipped: 3 

Vous pouvez trouver tout le code de test ici sur github: https://github.com/Joel-Costamagna/Selenium-Maven-Template

Répondre

0

Il semble que la version de Firefox et GeckoDriver ne correspondant les uns aux autres, s'il vous plaît vérifier la compatibilité des deux pour les versions.

Vous pouvez également essayer d'utiliser la dernière version de GeckoDriver qui peut être téléchargée à partir de https://github.com/mozilla/geckodriver/releases.

+0

Comment puis-je vérifier s'ils sont compatibles? J'ai mis à jour mon projet pour utiliser la dernière version, mais l'erreur est toujours là –

+0

J'ai essayé différentes versions de firefox et geckodrivers, mais cela ne résout pas mon problème. –