2017-05-23 1 views
0

Ich versuche, einen Selenium-Test auf einem Bambus-Server auszuführen, mit Xvfb, um eine Anzeige zu simulieren.Selen Nicht erreichbarBrowserException

Die Tests arbeiten mit ChromeDriver und PhantomJS, aber es Absturz mit 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 

Sie alle Testcode hier auf Github finden: https://github.com/Joel-Costamagna/Selenium-Maven-Template

Antwort

0

Es scheint, die Version von Firefox und GeckoDriver nicht ist übereinstimmen, überprüfen Sie bitte die Kompatibilität beider Versionen.

Sie können auch versuchen, die neueste Version von GeckoDriver zu verwenden, die von https://github.com/mozilla/geckodriver/releases heruntergeladen werden kann.

+0

Wie kann ich prüfen, ob sie kompatibel sind? Ich aktualisierte mein Projekt, um die neueste Version zu verwenden, aber der Fehler ist immer noch hier –

+0

Ich versuchte differents Versionen von Firefox und Geckodrivers, aber es löst nicht mein Problem. –