selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Unable to Start Firefox Using the Legacy Driver on a 3.5.3 Grid

Open bjharo opened this issue 9 years ago • 9 comments

Meta -

OS: Windows 10

Selenium Version: 3.5.3

Browser: Firefox

Browser Version: 52.3.0 ESR

Selenium Bindings: .NET 3.5.2

I'm currently testing out 3.5.3 to see if I can finally upgrade my grid from 3.3.1. I've decided to stick with Firefox 52 ESR and the legacy Firefox driver instead of using geckodriver and the latest Firefox due to existing issues in geckodriver. I'm running into an issue trying to start an instance of Firefox using the legacy driver. It works in two instances but not in the third.

Using the Browser Directly, No Standalone or Grid

This works properly. Firefox opens and my tests execute properly. This is the code I'm using to start the browser. var ffOptions = new FirefoxOptions { UseLegacyImplementation = true }; IWebDriver d = new FirefoxDriver(ffOptions);

Using the Browser via Selenium Server Standalone

This also works properly. I start the jar without any options like this: java -jar .\3.5.3.jar -enablePassThrough false

I start the browser like this: var legacyFfOptions = new FirefoxOptions { UseLegacyImplementation = true }; DesiredCapabilities capabilities = (DesiredCapabilities)legacyFfOptions.ToCapabilities(); IWebDriver driver = new RemoteWebDriver(RemoteServerUrl, capabilities, TimeSpan.FromSeconds(ConfigReader.BrowserTimeout / 1000));

Using the Browser via Grid Setup (Hub/Node)

This does not work. When my test tries to start up the browser, I'm getting an error at the hub which I will paste below.

I start the hub like this: java -jar .\3.5.3.jar -enablePassThough false -role hub

I start my node like this: java -jar \3.5.3.jar -enablePassThough false -role node -hub http://10.1.14.195:4444

The browser is started the same way as when I'm hitting a standalone server. This is the error the hub gives me when I try to start the browser.

Caused by: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {"desiredCapabilities":{"browserName":"firefox","version":"","platform":"ANY","acceptInsecureCerts":true,"marionette":false,"binary":"C:\\Program Files (x86)\\Mozilla Firefox\\Firefox.exe"},"capabilities":{"firstMatch":[{"browserName":"firefox","acceptInsecureCerts":true,"marionette":false,"binary":"C:\\Program Files (x86)\\Mozilla Firefox\\Firefox.exe"}]}} at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:78) at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.<init>(SeleniumBasedRequest.java:103) at org.openqa.grid.web.servlet.handler.WebDriverRequest.<init>(WebDriverRequest.java:40) at org.openqa.grid.web.servlet.handler.WebDriverRequestFactory.createFromRequest(WebDriverRequestFactory.java:30) at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.createFromRequest(SeleniumBasedRequest.java:74) at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:82) at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841) at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535) at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188) at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188) at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253) at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168) at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166) at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155) at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.seleniumhq.jetty9.server.Server.handle(Server.java:564) at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317) at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251) at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279) at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110) at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124) at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128) at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222) at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294) at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199) at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672) at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: W3C payload contained keys that do not comply with the spec: [marionette, binary] at org.openqa.selenium.remote.server.NewSessionPayload.validateSpecCompliance(NewSessionPayload.java:179) at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:372) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at org.openqa.selenium.remote.server.NewSessionPayload.validate(NewSessionPayload.java:164) at org.openqa.selenium.remote.server.NewSessionPayload.<init>(NewSessionPayload.java:146) at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:70) at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.<init>(SeleniumBasedRequest.java:103) at org.openqa.grid.web.servlet.handler.WebDriverRequest.<init>(WebDriverRequest.java:40) at org.openqa.grid.web.servlet.handler.WebDriverRequestFactory.createFromRequest(WebDriverRequestFactory.java:30) at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.createFromRequest(SeleniumBasedRequest.java:74) at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:82) at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841) at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535) at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188) at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188) at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253) at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168) at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166) at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155) at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.seleniumhq.jetty9.server.Server.handle(Server.java:564) at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317) at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251) at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279) at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110) at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124) at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128) at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222) at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294) at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199) at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672) at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590) at java.lang.Thread.run(Thread.java:745)

I've tried every combination of the `enablePassThrough' flag but the same error always comes up.

bjharo avatar Sep 05 '17 18:09 bjharo

You realize that the legacy Firefox driver won't work with Firefox 53, right? You might get the browser to launch, but the language bindings will be entirely unable to communicate with the driver (because Firefox will refuse to load the browser extension that is the legacy Firefox driver). I'd be very interested to know what "existing issues in geckodriver" prevent you from using it.

jimevans avatar Sep 05 '17 22:09 jimevans

@jimevans I'm using Firefox 52 ESR which does work with the legacy driver and I'm perfectly okay with testing on that version. I've been using v47 for a while now with the legacy driver as the issues with geckodriver have been worked out. While most of those issues have worked themselves out, currently, I seem to have a problem running multiple issues of geckodriver/firefox concurrently on one machine which is showstopper for me. The same set of tests will run fine with Chrome running concurrently and the legacy Firefox driver running concurrently, but will have random failures with geckodriver. My best guess at the moment is that this issue is the reason but I cannot be certain. The issue could be with Firefox and marionette but regardless, I have not had a stable test run using geckodriver and the latest version of Firefox.

bjharo avatar Sep 05 '17 23:09 bjharo

@jimevans The key part of the stacktrace is java.lang.IllegalArgumentException: W3C payload contained keys that do not comply with the spec: [marionette, binary] at org.openqa.selenium.remote.server.NewSessionPayload.validateSpecCompliance(NewSessionPayload.java:179) A binding should not pass OSS capabilities in W3C-compliant parts of payload, in "capabilities" block. They are allowed in "desiredCapabilities" block only.

barancev avatar Sep 06 '17 06:09 barancev

@barancev That's true, and the .NET bindings can be relatively easily patched to fix that issue. Stupid oversight on my part.

I'm more concerned with the claim that the legacy driver continues to work with Firefox >=48 without extraordinary measures (like building it oneself and signing the extension). That claim runs counter to everything I've experienced with Firefox over the last year, and contradicts all of the guidance we've given users in that time. If @bjharo is using the stock, out of the box experience against Firefox 52 (ESR or not), then something is very, very wrong. On the other hand, if extraordinary measures have been taken to use the legacy driver, that would be extremely relevant information to have, if only to correct the misperception that it ought to continue working.

jimevans avatar Sep 06 '17 09:09 jimevans

Mozilla broke Selenium compatibility in Firefox 48 in release channel, but restored it in version 52 in esr channel. It was unexpected, but it's true.

barancev avatar Sep 06 '17 09:09 barancev

I usually try to maintain a semblance of professionalism and decorum in this issue tracker, so I'm going to bow out of this conversation for a bit. That revelation about 52ESR makes me want to write things that are extremely unprofessional.

jimevans avatar Sep 06 '17 09:09 jimevans

Selenium 3.6 released, please check if the issue has been fixed.

barancev avatar Sep 28 '17 14:09 barancev

I can confirm that this issue is fixed.

bjharo avatar Sep 28 '17 18:09 bjharo

Thanks!

barancev avatar Sep 29 '17 05:09 barancev