Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox webdriver needs to be replaced by Marionette from Firefox version 47.0 #1025

Closed
mariusioana opened this issue Jun 15, 2016 · 26 comments

Comments

@mariusioana
Copy link

Hi,

With recent version of Firefox 47.0, selenium server latest version 2.53 does not work anymore:
http://stackoverflow.com/questions/37693106/selenium-2-53-not-working-on-firefox-47
SeleniumHQ/selenium#2110

So now it is recommended to just make use of Marionette to replace Firefox webdriver:
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver

Any recommendations on how to make it work now with nightwatchjs?

Thanks!

@redrockzee
Copy link

Firefox does not work. Neither does IEDriverServer.exe, The only driver that works anymore is Chrome.

@martineez
Copy link

martineez commented Jun 16, 2016

you have to download geckodriver (there's no nodejs wrapper)

  selenium: {
    cli_args: {
      'webdriver.gecko.driver': '/path/to/geckodriver'
    }
  },
  ...
  test_settings: {
    default: {
      desiredCapabilities: {
        browserName: 'firefox',
        marionette: true,
        javascriptEnabled: true
      }
}

@dealloc
Copy link

dealloc commented Jun 16, 2016

@martineez your suggestion got it working here for me, though the documentation should be updated (new users don't like having to skim issues for things like these)

@beatfactor
Copy link
Member

I'll add this to the docs soon.

@mariusioana
Copy link
Author

Thanks @martineez ! It worked. Though the problem now for is that with this new driver, following code seems to not work anymore. browser.api.execute seems that it does not work anymore to get the _initialState_ property from window object. This is a regression. Tried on Chrome the same and works nicely. Also, on older versions of FF works ok. So maybe this is a bug now? @beatfactor , any ideas? It kind of blocks me from running the tests and would really appreciate some help or guidance :). Thanks!

getSession: function(browser) {
    return new Promise(function(session) {
      browser.api.execute(function() {
        return {
          catalogUrl: window._initialState_.catalogUrl,
          accessToken: (JSON.parse(window.localStorage.getItem(window._initialState_.macConfig.clientId))).accessToken
        }
      }, [], function(result) {
        session(result.value);
      })
    });
  },

Error seen in session when used in debugging mode:

TypeError: window._initialState_ is undefined (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 8 milliseconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'ioana-osx.eur.adobe.com', ip: '10.131.168.79', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_74'
Driver info: org.openqa.selenium.firefox.MarionetteDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, appBuildId=20160604131506, version=47.0, platform=MAC, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, browserVersion=47.0, platformVersion=14.3.0, name=Cleanup Connections, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, javascriptEnabled=true, takesElementScreenshot=true, platformName=Darwin, device=desktop}]
Session ID: 90f93a94-e5dd-8b41-b8ce-ffacae5a4d9e

@beatfactor
Copy link
Member

Maybe this will help: https://bugzilla.mozilla.org/show_bug.cgi?id=825858?

@mariusioana
Copy link
Author

Excellent, it worked! Thanks @beatfactor !

@aeneasr
Copy link

aeneasr commented Jul 17, 2016

i tried @martineez hints but my firefox (47.0.1) just opens about:blank&utm_content=firstrun and returns

Error retrieving a new session from the selenium server

Connection refused! Is selenium server started?
{ state: 'unhandled error',
  sessionId: null,
  hCode: 1075377371,
  value: 
   { localizedMessage: 'Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox conso
le

nightwatch.json

{
  "src_folders" : ["tests"],
  "output_folder" : "reports",
  "custom_commands_path" : "",
  "custom_assertions_path" : "",
  "page_objects_path" : "",
  "globals_path" : "",

  "selenium" : {
    "start_process" : true,
    "server_path" : "./bin/selenium-server-standalone-2.53.0.jar",
    "log_path" : "",
    "host" : "127.0.0.1",
    "port" : 4444,
    "cli_args" : {
      "webdriver.chrome.driver" : "",
      "webdriver.ie.driver" : "",
      "webdriver.gecko.driver": "C:\\ChromeDriver\\geckodriver.exe"
    }
  },

  "test_settings" : {
    "default" : {
      "launch_url" : "http://localhost:3000",
      "selenium_port"  : 4444,
      "selenium_host"  : "localhost",
      "silent": true,
      "screenshots" : {
        "enabled" : false,
        "path" : ""
      },
      "desiredCapabilities": {
        "browserName": "firefox",
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    },

    "chrome" : {
      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    }
  }
}

@CleanCodeWillKeepYouAlive
Copy link

same prob as @arekkas has, pass step with dowload gecko driver and specified path in configure file but error still displayed:
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?

@straris
Copy link

straris commented Jul 25, 2016

Same here :(

@ghost
Copy link

ghost commented Aug 9, 2016

@arekkas You missed the marionette: true, from martineez's config example

@beatfactor
Copy link
Member

This should be closed and moved to the wiki (until we have a section on the website) Is someone who has got it working able to summarize this and create a wiki article? Thanks.

@aeneasr
Copy link

aeneasr commented Aug 24, 2016

@DanC-UNiDAYS indeed, thank you!

@aeneasr
Copy link

aeneasr commented Aug 24, 2016

The config I got it working with is:

{
  "src_folders" : ["tests"],
  "output_folder" : "reports",
  "custom_commands_path" : "",
  "custom_assertions_path" : "",
  "page_objects_path" : "",
  "globals_path" : "",

  "selenium" : {
    "start_process" : true,
    "server_path" : "./bin/selenium-server-standalone-2.53.0.jar",
    "log_path" : "",
    "host" : "127.0.0.1",
    "port" : 4444,
    "cli_args" : {
      "webdriver.chrome.driver" : "",
      "webdriver.ie.driver" : "",
      "webdriver.gecko.driver": "C:\\ChromeDriver\\geckodriver.exe"
    }
  },

  "test_settings" : {
    "default" : {
      "launch_url" : "http://localhost:3000",
      "selenium_port"  : 4444,
      "selenium_host"  : "localhost",
      "silent": true,
      "screenshots" : {
        "enabled" : false,
        "path" : ""
      },
      "desiredCapabilities": {
        "browserName": "firefox",
        "javascriptEnabled": true,
        "acceptSslCerts": true,
        "marionette": true
      }
    },

    "chrome" : {
      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    }
  }
}

@IceCreamYou
Copy link

IceCreamYou commented Sep 7, 2016

FWIW, I was able to get this working with geckodriver 0.9.0 and Selenium 2.53.1 as described above. I was not able to get it working with geckodriver 0.10.0 + Selenium 3.0.0-beta2 or with geckodriver 0.10.0 + Selenium 2.53.1.

Update: Seems to work with geckodriver/Marionette 0.11.1 and Selenium 2.53.1, although I haven't been able to get mouseButtonClick() to work in any version of geckodriver. click() does seem to work.

@traviskaufman
Copy link

Same here: Not able to get it working without redundantly downloading a lesser version of the geckodriver :(

@naissa12
Copy link

naissa12 commented Sep 9, 2016

I get the following errors when I run geckodriver with selenium 2.53

(firefox:25304): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed
JavaScript warning: https://normandy.cdn.mozilla.net/static/bundles/selfrepair-5c0beb002c2cc297accf.57474d2dada3.js, line 7: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create

Does anyone get this error?

@naissa12
Copy link

naissa12 commented Sep 9, 2016

@arekkas what version of firefox are you using?

@naissa12
Copy link

naissa12 commented Sep 9, 2016

which one is that?

@aeneasr
Copy link

aeneasr commented Sep 9, 2016

48.0.2

Am 10.09.2016 um 00:01 schrieb naissa12 notifications@github.com:

which one is that?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #1025 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ADN1eo_pJ-VlXEk-2fVds4kC8uDWCLWsks5qodcngaJpZM4I2Gca.

@naissa12
Copy link

naissa12 commented Sep 9, 2016

@arekkas what OS?

@vangorra
Copy link

vangorra commented Oct 9, 2016

FYI. Looks like a geckdriver is now availble through npm.

https://www.npmjs.com/package/geckodriver

@potapovDim
Copy link

potapovDim commented Nov 3, 2016

@naissa12

{
  "src_folders": [
    "tests"
  ],
  "output_folder": "reports",
  "custom_commands_path": "commands",
  "custom_assertions_path": "",
  "page_objects_path": [
    "pages/account",
    "pages"
  ],
  "globals_path": "globals.js",
  "selenium": {
    "start_process": true,
    "server_path": "./node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar",
    "log_path": "",
    "host": "127.0.0.1",
    "port": 4444,
    "cli_args": {
      "webdriver.chrome.driver": "./node_modules/webdriver-manager/selenium/chromedriver_2.25",
      "webdriver.gecko.driver": "./node_modules/geckodriver/geckodriver",
      "webdriver.opera.driver": "./node_modules/operadriver/lib/operadriver.js"
    }
  },
  "test_settings": {
    "default": {
      "launch_url": "http://localhost",
      "selenium_port": 4444,
      "selenium_host": "localhost",
      "silent": true,
      "screenshots": {
        "enabled": false,
        "path": ""
      },
      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    },
    "phantom": {
      "desiredCapabilities": {
        "browserName": "phantomjs",
        "javascriptEnabled": true,
        "acceptSslCerts": true,
        "phantomjs.binary.path": "./node_modules/phantomjs/bin/phantomjs",
        "phantomjs.cli.args": [
          "--ignore-ssl-errors=true"
        ]
      }
    },
    "safari": {
      "desiredCapabilities": {
        "browserName": "safari",
        "version": "49",
        "api_key": "api_key",
        "api_secret": "api_secret"
      }
    },
    "firefox":{
      "desiredCapabilities": {
        "browserName": "firefox",
        "javascriptEnabled": true,
        "acceptSslCerts": true,
        "marionette": true
      }
    }
  }
}

@dayanamcc
Copy link

how can addapt the same but into wdio.conf.js but instead of using nitghwatch using WebdriverIO
webdriverIO + selenium-server v2.53.1 and ghekodriver ???

i want something like this
selenium: {
cli_args: {
'webdriver.gecko.driver': './---path-to geckodriver--/0.13.0-x64-geckodriver'??
}
},

but into webdriverIO

this is how is working now on IE and on Chrome
services: ['selenium-standalone']

   seleniumArgs: {
      version: '2.53.1',
      drivers: {
      ie: {
          version: '2.53.1',
          arch: 'ia32',
          baseURL: 'https://selenium-release.storage.googleapis.com',
      },
      chrome: {
          version: '2.27',
          arch: process.arch,
          baseURL: 'https://chromedriver.storage.googleapis.com'
      },
      firefox:{
               should i set something here ¿? or? 
      }
    }
  },

@straris
Copy link

straris commented May 2, 2017

@dayanamcc shouldn't you be asking that on webdriverIO instead?

@stale
Copy link

stale bot commented Nov 14, 2018

This issue has been automatically marked as stale because it has not had any recent activity.
If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.

@stale stale bot added the stale label Nov 14, 2018
@stale stale bot closed this as completed Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests