18

After seeing that this is a problem with Firefox 35, I installed 34 and ran bundle exec rspec and my tests ran perfectly. But when I tried running it again, it somehow opened the newer version of Firefox as I get the following error again when I run my test suite:

 Selenium::WebDriver::Error::JavascriptError: arguments[0] is undefined

Is there a way to guarantee that I don't have Firefox 35 installed that Selenium is somehow finding and opening? I know that Firefox 34 is the version of the Firefox in my Applications directory, but I am not certain there isn't a replica copy of a newer firefox that Selenium is grabbing when launchy is used.

Thalatta
  • 4,510
  • 10
  • 48
  • 79

3 Answers3

15

This is a known issue with the current release of selenium.

As @janders223 points out in a comment on another question, the temporary workaround for a Ruby project is to use the dev version of the selenium-webdriver gem.

Modify your Gemfile to specify the latest dev version (as of this writing):

gem 'selenium-webdriver', '>=2.45.0.dev3'

Then run bundle install.

Community
  • 1
  • 1
Mike Mazur
  • 2,509
  • 1
  • 16
  • 26
  • 1
    It's no longer in dev, latest version now is `2.45.0`, just `bundle update selenium-webdriver` – O.O Feb 28 '15 at 03:15
8

So, this is incredibly basic, but I found that when I had installed Firefox 34 via the dmg listed here, because I had naïvely just dragged and dropped the Firefox icon into the Applications folder clicking "Yes, I would like to overwrite the extant application" I hadn't ensured all of the newer files of Firefox 35 weren't available for Selenium to use, which Selenium availed itself of without me knowing which version it was choosing.

I simply uninstalled Firefox completely from my the mac by dragging it into the Trash, & reinstalled the Firefox 34 dmg.

N.B. Also if you run into this issue, when you download Firefox 34, you have to go to Firefox >Preferences>Advanced , click the Update tab, and choose "Check for updates, but let me choose whether to install them" or "Never check for updates" to prevent Firefox from automatically updating to Firefox 35 and therefore messing with your Selenium test suite the next time you run them again.

Thalatta
  • 4,510
  • 10
  • 48
  • 79
  • 3
    While this is a fix that will temporarily resolve this issue, it is not always possible to downgrade a Firefox version. The latest dev version of selenium-webdriver will also solve this issue allowing you to run Firefox version 35. `gem 'selenium-webdriver', '2.45.0.dev3'` – janders223 Feb 04 '15 at 01:04
0

This problem also appearing in python selenium package nowdays. it is possible, that "arguments" appearing in code eventually. It can be solved simply by announsing all arguments at start in different var variables. Approved answer showing this technique.

xillmera
  • 22
  • 3