Running Protractor against a nightly Firefox build

非 Y 不嫁゛ 提交于 2019-12-22 17:28:08

问题


When I try to run Protractor tests against a "Nightly" Firefox build, firefox window hangs indefinitely:

Here is the relevant part of my configuration:

exports.config = {
    baseUrl: 'http://localhost:8080/dev/src/',
    specs: ['dev/test/e2e/**/dashboard.spec.js'],
    directConnect: true,
    capabilities: {
        browserName: "firefox",
        firefox_binary: "/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin",
    },

    allScriptsTimeout: 110000,
    getPageTimeout: 100000,
    framework: 'jasmine2',
    jasmineNodeOpts: {
        isVerbose: false,
        showColors: true,
        includeStackTrace: false,
        defaultTimeoutInterval: 400000
    },
};

There was a related issue with no solution provided.

One of the possible workarounds I've found might be to move the WebDriver xpi extension from the stable firefox installation (or a different source) to the "extensions" directory of the Nightly firefox profile, but I'm not sure how to do it.

I've also found something about using "Marionette" driver to test a nightly Firefox build, but I haven't found any guidelines on it's relationship to Protractor.


Using:

  • currently latest Protractor 3.0.0
  • Firefox Nightly is 46.0.a1
  • Mac OS X El Capitan

Tried with directConnect and without - same behavior.


回答1:


Apparently this is an issue with Firefox 46. The default FirefoxDriver no longer works with this version - you need to be using the Marionette driver. I also found a quick how-to on using the new driver with Selenium.

I'm facing the same problem as well. We run our tests with directConnect by default, so I'm yet to figure out how to get protractor to use Marionette instead of FirefoxDriver.

If you're having protractor connect to Selenium, then you should be able to follow the guides available to make Selenium use the new driver - that shouldn't affect protractor's relationship with Selenium.


Update: Looking into the problem of using the latest versions of Firefox with directConnect, I found no way of instructing protractor to use the Marionette driver. I've opened an issue with the protractor team for this.




回答2:


On both Mac and Linux I had to update to FF 47.0.1 selenium 2.53.1.

I initially explored trying to configure Protractor with the new Mozilla Marionette driver, per the answer by jrharshath

I got protractor to use it (description of what I did below). However, I had manifold problems with the driver running my tests.

I then found discussions saying 47.0.1 and selenium 2.53.1 restored FirefoxDriver functionality, so abandoned the Marionette driver in favor of compatible upgrades.

For those looking at configuring and using the Marionette driver with Protractor and webdriver I did the following:

  1. Downloaded and unzipped the latest Marionette driver from https://github.com/mozilla/geckodriver/releases
  2. Renamed it to wires and put it on the path
  3. Started a standalone selenium webdriver 2.53.1 with the -Dwebdriver.gecko.driver=${path_to_driver} property, and used that server.
  4. Set marionette true in my firefox capabilities in my config, ie : multiCapabilities:[ { 'browserName': 'chrome' } }, { 'browserName': 'firefox', 'marionette' : true } ],


来源:https://stackoverflow.com/questions/34446868/running-protractor-against-a-nightly-firefox-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!