selenium3 and firefox

1,713 views
Skip to first unread message

Jon Schewe

unread,
Nov 13, 2016, 9:23:04 PM11/13/16
to Selenium Users
I'm trying to use the new geckodriver with selenium. I'm using geckodriver 0.11.1. I'm using selenium 3.0. I have firefox 49.

I have tried creating the driver object these 2 options:
1)
    final DesiredCapabilities capabilities = DesiredCapabilities.firefox();
    capabilities.setCapability("marionette", true);
    final WebDriver selenium = new FirefoxDriver(capabilities);

2)
    final WebDriver selenium = new FirefoxDriver();

In both cases a firefox window opens, but then nothing happens. No errors, but nothing happens in the browser either. What am I doing wrong?

Here is the output of my test application:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/jpschewe/projects/fll-sw/working-dir/scoring/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/jpschewe/projects/fll-sw/working-dir/scoring/lib/cobertura/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
14943 [main] INFO io.github.bonigarcia.wdm.BrowserManager - Latest version of [wires, geckodriver] is 0.11.1
14987 [main] INFO io.github.bonigarcia.wdm.BrowserManager - Exporting webdriver.gecko.driver as /home/jpschewe/.m2/repository/webdriver/geckodriver/linux64/0.11.1/geckodriver
1479059879146 geckodriver INFO Listening on 127.0.0.1:17580
Nov 13, 2016 11:57:59 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
1479059879227 mozprofile::profile INFO Using profile path /tmp/user/1000/rust_mozprofile.qW7OD2lv7bWg
1479059879227 geckodriver::marionette INFO Starting browser /usr/bin/firefox
1479059879229 geckodriver::marionette INFO Connecting to Marionette on localhost:40496
1479059879733 Marionette INFO Listening on port 40496


Jon Schewe

Saravanan Jothimani

unread,
Nov 14, 2016, 9:14:47 AM11/14/16
to Selenium Users
Hi Jon, 

Please execute mvn dependecny:tree and check.
SLF4J jar might be referenced in multiple jars with different version. 
So, please remove and execute and check whether issue exists. 

Thanks

Saravanan


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/4ceee3ad-6878-47c6-a83b-2d416487b11d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jon Schewe

unread,
Nov 14, 2016, 9:34:00 AM11/14/16
to seleniu...@googlegroups.com

I'm not using maven. That error has been in my test before and it worked with older versions of Firefox. So I really doubt that is it.

Sent from my mobile device


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJ9UOtHHOnNH8Xr4_p1M7Lo_n-ubU7RnFPXAvrWx%2BspD7OUeog%40mail.gmail.com.

skd

unread,
Nov 14, 2016, 1:06:07 PM11/14/16
to Selenium Users
You can just tell Selenium where to find the gecko driver:

            System.setProperty("webdriver.gecko.driver", "firefoxDriver"+File.separator+"geckodriver.exe");
            driver = new FirefoxDriver();
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Jon Schewe

unread,
Nov 14, 2016, 7:43:45 PM11/14/16
to seleniu...@googlegroups.com
I'm doing that with Web Driver Manager as it ensures that I have the latest version downloaded and for the correct platform.

That being said, how do I debug this not working? What should I be looking into why commands are not getting sent to the web browser?

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/f805061f-12f1-403c-8e5b-95c8fa6dc83d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jon Schewe

unread,
Nov 23, 2016, 10:33:23 AM11/23/16
to seleniu...@googlegroups.com
OK, I've removed the extra reference to SLF4J and my system has upgraded Firefox to 50. Here's the output of my connection showing an error talking to the browser. Seeing the post about browsers and versions suggests that I should start using Chrome to test instead of Firefox. Is that correct?


23994 [main] INFO io.github.bonigarcia.wdm.BrowserManager - Latest version of [wires, geckodriver] is 0.11.1
24040 [main] INFO io.github.bonigarcia.wdm.BrowserManager - Exporting webdriver.gecko.driver as /home/jpschewe/.m2/repository/webdriver/geckodriver/linux64/0.11.1/geckodriver
1479914836876 geckodriver INFO Listening on 127.0.0.1:1152
Nov 23, 2016 9:27:16 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
1479914836954 mozprofile::profile INFO Using profile path /tmp/user/1000/rust_mozprofile.T7hehADuYAP7
1479914836954 geckodriver::marionette INFO Starting browser /usr/bin/firefox
1479914836956 geckodriver::marionette INFO Connecting to Marionette on localhost:41667
1479914837794 Marionette INFO Listening on port 41667
Nov 23, 2016 9:27:19 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
26895 [main] INFO fll.web.FullTournamentTest - Initializing the database
[Child 5276] ###!!! ABORT: Aborting on channel error.: file /build/firefox-RaD34G/firefox-50.0+build2/ipc/glue/MessageChannel.cpp, line 2056
[Child 5276] ###!!! ABORT: Aborting on channel error.: file /build/firefox-RaD34G/firefox-50.0+build2/ipc/glue/MessageChannel.cpp, line 2056

###!!! [Child][MessageChannel] Error: (msgtype=0x420003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv


###!!! [Child][MessageChannel] Error: (msgtype=0x420003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv

27153 [main] FATAL fll.web.ReplayTournament - Unexpected error
org.openqa.selenium.WebDriverException: Reached error page: about:neterror?e=connectionFailure&u=http%3A//localhost%3A9080/fll-sw/setup/&c=UTF-8&f=regular&d=Firefox%20can%E2%80%99t%20establish%20a%20connection%20to%20the%20server%20at%20localhost%3A9080.
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'jon-laptop', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-47-generic', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, firefoxOptions={args=[], prefs={}}, appBuildId=20161114144739, version=, platform=LINUX, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=5189, browserVersion=50.0, platformVersion=4.4.0-47-generic, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=linux}]
Session ID: 02acb888-cf19-4e1b-b88a-7f77c66428bb
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:127)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:93)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:322)
at fll.web.IntegrationTestUtils.initializeDatabase(IntegrationTestUtils.java:180)
at fll.web.IntegrationTestUtils.initializeDatabase(IntegrationTestUtils.java:142)
at fll.web.FullTournamentTest.replayTournament(FullTournamentTest.java:237)
at fll.web.ReplayTournament.main(ReplayTournament.java:96)

To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Andreas Tolfsen

unread,
Nov 23, 2016, 10:39:32 AM11/23/16
to seleniu...@googlegroups.com
Jon Schewe <jpsc...@gmail.com> writes:
> OK, I've removed the extra reference to SLF4J and my system has
> upgraded Firefox to 50. Here's the output of my connection showing an
> error talking to the browser. Seeing the post about browsers and
> versions suggests that I should start using Chrome to test instead of
> Firefox. Is that correct?
>
> org.openqa.selenium.WebDriverException: Reached error page: about:neterror?e=connectionFailure&u=http%3A//localhost%3A9080/fll-sw/setup/&c=UTF-8&f=regular&d=Firefox%20can%E2%80%99t%20establish%20a%20connection%20to%20the%20server%20at%20localhost%3A9080

This error indicates that Firefox is unable to connect to
http://localhost:9080/.

Jon Schewe

unread,
Nov 23, 2016, 10:48:30 AM11/23/16
to seleniu...@googlegroups.com
Thank you. Sorry to bother. I was so focused on the error from before that I assumed I was still stuck on a selenium error. Everything works now.



--

Andreas Tolfsen

unread,
Nov 23, 2016, 11:05:53 AM11/23/16
to seleniu...@googlegroups.com
If you have an idea how we can make this error message better, please
let us know.

The current message is highly specific, but perhaps does not
communicate in an easy to understand fashion what the source of the
problem is.

dheeraj bharti

unread,
Nov 24, 2016, 3:58:17 AM11/24/16
to Selenium Users
Jon,

How did you fix the issue? Are you still using firefox 50 or downgraded to 49?

Regards,
Dheeraj

Jon Schewe

unread,
Nov 24, 2016, 10:26:34 AM11/24/16
to seleniu...@googlegroups.com
I removed the extra reference to SL4J, which I wouldn't have expected to make a difference. My browser was upgraded from FF 49 to FF 50. When I ran this time it's all working. I did need to add some pauses after page loads to ensure that the browser had finished loading before doing the next action, but otherwise it's working.

Now on my Jenkins system I'm using firefox 45 and the same code isn't behaving as well. Selenium is properly connecting, but some of my browser actions aren't taking place. I suspect that's something with timing as my Jenkins system is much slower than the system that I've been testing on.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages