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.
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
.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With