Providing Firefox 28 programatically for Selenium Webdriver (w/ ruby) - ruby

Selenium-webdriver gem versions require specific firefox versions (always a lagging a bit, understandably). See: Unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
In this case, I require firefox 28 for gem version 2.41.0 (2014-03-28). See: http://selenium.googlecode.com/git/rb/CHANGES
My problem is I have Firefox 32 installed (up to date as of current). I need to provide a stable environment for my script which will likely run on other systems too. I can easily lock the gem version through bundler, but how do I provide Firefox 28 consistently across environments? Is it possible to ask selenium webdriver to use a local firefox 'installation'?
I am on Ubuntu but I would greatly prefer a more general solution. This is the install I would use for my system: http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/linux-x86_64/en-US/

It is possible to configure Selenium to use a different firefox install:
Selenium::WebDriver::Firefox.path = "/path/to/firefox"
Now I can download the required version, put it somewhere, and have Selenium use it.

Related

How can I achieve Protractor support for Firefox 48 and up?

For quite sometime now I have been trying to run protractor with Firefox (Windows) v48 and above to run my AngularJS application.
However, as per protractor docs:
WebDriver support for Firefox has changed recently, and Firefox version
48 does not work properly with the current tools. For the moment, we
recommend testing against Firefox 47
This information was updated 3 years ago and nothing seems to have been done afterward.
Versions
OS - Windows 10 64-bit
Protractor - 5.4.2
Firefox - 68
selenium-stanalone-server: 2.53.1
AngularJS - 1.6.9
I did raise an issue recently on GitHub for the same, but it has not received traction yet.
I would like to know if anyone has been able to get around the issue for Windows.
Yikes, Firefox 48 is probably 2-ish years old. What you'll need to use is geckodriver. webdriver-manager should download the latest geckodriver automatically and you can either use direct connect or selenium standalone server to run this.
To download only the geckodriver binary, you could use:
webdriver-manager update --chrome false --standalone false
Note: chromedriver and selenium standalone jar file are downloaded automatically and these flags will turn them off.
When you want to start the server, you'll just use:
webdriver-manager start
or you could use directConnect. Direct connect will work as long as you used
a local version of webdriver-manager. It will not work if you used a global installed version of webdriver-manager.

Getting a Ruby "KeyError: key not found: 102" error when trying to maximize browser window using Selenium Webdriver v3.70

I've recently upgraded my Selenium Webdriver version to 3.70 and when I try to maximize the browser window, I get this error:
KeyError: key not found: 102
Maximizing the window beforehand (on the previous version) seemed to be working absolutely fine, I'm not sure if it's just a coincidence though as it isn't a standard type of Selenium error.
Here's my code:
profile = Selenium::WebDriver::Chrome::Profile.new
$driver = Selenium::WebDriver.for :chrome, :profile => profile
$driver.manage.window.maximize
Anyone else having this problem? Also worth noting I'm using Ruby v2.3.1, so perhaps that needs updating? I just didn't want to make loads of drastic updates, but wanted the latest Selenium Webdriver version. I also don't know whether it's chromedriver related, but last updated this to the latest version on 19/09/17.
Thanks in advance,
Dan
Upgrade chromedriver to 2.33.
On Mac you can upgrade it via brew brew upgrade chromedriver

watir with ruby on ubuntu not connecting

I get the following error:
unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
I am trying to run Rspec with watir, the ruby gem, on an Ubuntu box.
But I keep getting this error on Firefox 42.
I'm not sure what I need to do to resolve this networking issue.
Read the following but I am on a way later version of Firefox:
unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
Unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
gem update selenium-webdriver
Read the following but I am on a way later version of Firefox:
At the first link it says:
[Update - this can (was for me) still be a fix for this issue in 2015
|mdurrant|]
And:
Important note: The selenium-webdriver gem is updated, and a new
version released, for every subsequent version of Firefox. Presently,
version 2.25.0 is needed to support Firefox 15.
But your solutions was:
gem update selenium-webdriver
...which is not my interpretation of those posts. My interpretation is NOT that you always need the latest selenium for whatever version of Firefox you are using--rather they are trying to tell you that you need to match a selenium version to a Firefox version.
And in fact, there is an SO question titled:
Where can I find a definitive Selenium WebDriver to Firefox
Compatibility Matrix?
So, it looks to me like the latest version of selenium does not support Firefox 42. You need to install an earlier version of Firefox.

Firefox version affects selenium webdriver test cases. What is the reason?

I have updated my Firefox version from v31 to v32. When I created my test cases in .net using web-driver, it was running perfectly in Firefox version 31 but as soon as I have updated my version to 32 it stopped running. It only opens the browser and doesn't navigate to URL. To solve this issue I uninstalled the v32 and installed v31 and its working fine. But I want to run on latest version.
Please advice. Any help would be appreciated.
Selenium WebDriver versions and Firefox versions are tightly coupled.
You need to use a Selenuim WebDriver version which supports Firefox v32. Usually the latest Firefox version supported in a particular Selenium WebDriver release is mentioned in the CHANGELOG.
If memory serves me, I believe Firefox v32 is supported in Selenium 2.43.0

Using Capybara with Headless in Windows OS

I am using headless gem to run Capybara without opening browser in Linux. Headless uses xvfb. Is there something similar for Windows OS or Mac?
Both capybara-webkit and poltergeist run just fine on a mac.
Poltergeist uses phantomjs to do the heavy lifting, which is available on windows so poltergeist could probably be made to work there, although its documentation says windows isn't supported.
Capybara-webkit lists 32bit windows as a community supported platform, so it should hopefully work there.

Resources