protractor: directConnect not working with FF 52+ and Protractor 5.1.1 (unable to parse new session response)

Protractor 5.1.1 is using version 3.0.1 of the Selenium JS bindings. When using directConnect: true Protractor will control geckodriver directly. Unfortunately, this version of the JS bindings is no longer compatible with the latest geckodriver (See https://github.com/mozilla/geckodriver/issues/555 https://github.com/mozilla/geckodriver/issues/529 and https://github.com/SeleniumHQ/selenium/issues/3607).

The solution is to use selenium standalone when testing with Firefox. The latest version of the selenium standalone server is compatible with Protractor’s selenium JS bindings and with geckodriver. You can update and launch the standalone server with

webdriver-manager update
webdriver-manager start

and set seleniumAddress: http://localhost:4444. For an example using selenium standalone, see protractor cookbook. Note Protractor 5.1.1 requires Selenium 3 or greater and Firefox 52 or greater.

In the meantime, directConnect: true will not work with Firefox until the external issues are fixed and Protractor’s selenium-webdriver version is updated.

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 12
  • Comments: 26 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I have the same issue, with the same version as in the last comment. Do anybody know where is the problem?

Been beating my head against this for the past day and a half. Hopefully this gets fixed soon.

Still having an issue running geckodriver with directConnect: true, but I was able to make it work if I change geckoDriverFile in _\protractor\built\driverProviders\direct.js_ to reference directly to the location of geckodriver. it looks like the update-config.json not getting updated with geckoDriverFile !!!

I’m using: Protractor: 5.2.2 firefox: 57.0.2

There are various issues talking about Firefox that are somewhat out of date or confusing, so I thought I’d collect the latest info in a new issue.

Protractor 5.1.1 requires the latest Selenium 3 and only works with Firefox 52 or higher (you might be able to get Firefox < 47 working with marionette: false, I’m not sure). You need to use a selenium standalone server, directConnect: true will not work due to the above external issues. This is the case for geckodriver 0.15. Firefox 52, and Protractor 5.1.1, but may change with future versions.

Geckodriver is maturing and getting closer to the spec, so I’m betting directConnect will work again in future Protractor releases with updated selenium-webdriver JS bindings.

This is fixed in the current version of Protractor: 5.2.0.

That’s correct. And Protractor does currently work with selenium-webdriver 3.3.0. However, the tricky part is bringing all the typings up to date. Unfortunately, we don’t really have the time to maintain the selenium-webdriver typings, but assuming they’re accurate and up to date the next steps would be:

The hardest part is making sure the selenium-webdriver types are accurate with selenium-webdriver 3.4.0. But if some enterprising individual wanted to take that on (see how to contribute to DefinitelyTyped), then we could easily update Protractor and resolve this issue.

@Supamiu

That is doesn’t work with directConnect is a known issue. The path is not correctly set in Protractor. This has been fixed on Github by @cnishina , but not in a new release.

I tried to run it locally without directConnect and Firefox 55 and GeckoDriver 0.19.0 + Selenium 3.5.3 and 3.4.0 and they all work. Can you provide more info about your config / script and so on to verify where the problem is?

I’ve run into this as well; the typings are a bit crazy. @seanmay I’d be happy to try and pair/work through these with you because i’d love to have a clean(er) typing story moving forward.

Thanks also for collecting this. As far as I (naively) see there seem to be no relevant external bugs open anymore, so the “only” thing missing would Protractor updating it’s Selenium JS Bindings to match the requirements of geckodriver…?