which firefox version is compatible with selenium 3.5.0? - selenium

I tried with Selenium 3.5.3 GeckoDriver 0.19 Firefox 55 but getting below exception:
Error: org.openqa.selenium.WebDriverException: browser name not boolean
Code :
DesiredCapabilities cap = DesiredCapabilities.firefox();
WebDriver driver = null;
System.setProperty("webdriver.gecko.driver", "<path to gecko>\geckodriver.exe");
cap.setBrowserName("firefox");
URL sURL= null;
cap.setCapability("firefox_binary", "<FIREFOX_PATH>"));
//Grid
sURL = new URL("http://localhost:5555/wd/hub");
driver = new RemoteWebDriver(sURL, cap);
Also saw this thread https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/ that selenium ide would not be supported anymore in Firefox 55. Whether selenium jar would be still supported?

It was a bad news for the tester community since Selenium IDE no long works from Firefox 55 onwards. Now you have 2 choices:
1- Try with previous version of firefox (Temporary solution)
2- Use Selenium IDE alternatives (Highly Recommended)

I recommend you to use Firefox 54.0 and geckodriver v0.18.0.
Actually this links regarding Selenium IDE. You can use firefox 55 also.

Related

Use of Selenium 3.0 with Firefox V<47

Selenium3 supports executable geckodriver to launch Mozilla Firefox just like other drivers; but executable geckodriver is not compatible with Mozilla Firefox < v47.
So How can we achieve backward compatibility with browsers V<47 i,e how can we use firefox browsers V<47 with Selenium3.
Disable the geckodriver capabilities so that FirefoxDriver can be used.
System.setProperty("webdriver.gecko.driver", "path/to/geckodriver.exe");
DesiredCapabilities d = new DesiredCapabilities();
d.setCapability("marionette", false); // to disable marionette, by default true
WebDriver driver = new FirefoxDriver(d);
Little Background to geckodriver.exe and Firefox version support:
From geckodriver github page:
Firefox 47 is explicitly not supported
So, If you want to use <= Firefox 47 version, use Firefox driver but not geckodriver.
In case of selenium 2.53, you don't need to do any additional things (no need to setup geckodriver as selenium 2.53 uses Firefox driver by default).
In Selenium 3.0, we must set geckodriver path (as geckodriver is the default driver for Firefox in Selenium 3.0) using System.setProperty and set marionette to false, so geckodriver capabilities will be disabled and default Firefox driver is used.
References:
https://github.com/mozilla/geckodriver#supported-firefoxen
https://github.com/mozilla/geckodriver/issues/224
https://stackoverflow.com/a/40658421/2575259
You should use old FirefoxDriver, just make sure to set marionette on false if you are using RemoteDriver because I'm not sure is it enabled by default (caps.setCapability(FirefoxDriver.MARIONETTE, false);)
This driver doesn't need any .exe file, just import org.openqa.selenium.firefox.FirefoxDriver; in your code so you could use it.
driver = new FirefoxDriver();
or if you are using grid:
driver = RemoteWebDriver(url, DesiredCapabilities.firefox());

Firefox not working with selenium

I'm using firefox 41.0b1 and selenium standalone 2.53.1 .issue is firefox run in sometimes and not always.error is Unable to connect to host 127.0.0.1 on port 7056 after 45000 ms. Firefox console output: also I'm using testNG.hoping for a good solution
this combination of firefox and selenium won`t work.
you could try to upgrade your firefox to version 47.0.1 which works with selenium 2.53.1
Use gecokDriver instead of firefoxDriver it will work smoothly with any version of firefox.
Code will look like below, make sure to set appropriate path where your gecodriver.exe is located:
System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "/BrowserDrivers/geckodriver.exe");
DesiredCapabilities cap = DesiredCapabilities.firefox();
cap.setCapability("marionette", true);
WebDriver driver = new MarionetteDriver(cap);
driver.get("http://www.seleniumhq.org");
driver.quit();

Selenium 2.53 or 2.48 not working in Firefox 48.0

I am getting an error in Firefox 48.0 in new the update from firefox 47
Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.
Firefox console output: 066 addons.xpi DEBUG Updating database with
changes to installed add-ons
My system and browser configuration are:
Firefox 48
Selenium 2.48 also try 2.53
Window 8 64bit
I also tried the marionette driver but did not receive proper output with that.
Any ideas on how to fix this besides downgrading firefox?
Older versions of Selenium (like 2.5.x) do not work and won't work with Firefox 48+.
The reason is that Firefox 48 changed a lot of stuff, including the fact that extensions must be signed by Mozilla to work with Firefox.
To fix the Selenium issue, Mozilla took ownership of FirefoxDriver() and they a released a Marionette version for this, including a Gecko driver.
This is what you need to use to be able to execute your tests on Firefox 48+.
I would recommend downloading firefox 46 which seems to be the best match for selenium 2.53.x.
https://ftp.mozilla.org/pub/firefox/releases/46.0.1/win64/en-US/
Once I downgraded to firefox 46.0.1 everything was working as expected.
I found another solution for my question with Firefox 48 and Selenium 3.0.0(Beta 3) because Selenium 2.48 didn't work.
If you want run selenium script then you have to download....
Selenium 3.0.0(Beta 3) - http://www.seleniumhq.org/download/
GeckoDriver exe - http://www.seleniumhq.org/download/
put below code in your script
public class FirefoxTest{
public static void main(String args[]) throws InterruptedException{
System.setProperty("webdriver.gecko.driver", "Path + geckodriver.exe");
//For E.g ("webdriver.gecko.driver", "C://geckodriver.exe")
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette",true);
WebDriver driver = new FirefoxDriver(capabilities);
String baseUrl = "https://www.google.com";
driver.get(baseUrl);
}
}

How to check Firefox version when running Selenium tests in Jenkins?

Selenium plug has integrated Firefox. I would like to know how to check version of Firefox.
It's very easy. You should use the browser capatibilities. But it's not a plugin.
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
WebDriver driver = new FirefoxDriver();
Capabilities caps = ((RemoteWebDriver) driver).getCapabilities();
String browserName = caps.getBrowserName();
String browserVersion = caps.getVersion();
System.out.println(browserName+" "+browserVersion);
From Firefox version 48 and forward, geckodriver capabilites are in place. With selenium you can get the Firefox version number using "browserVersion", like in this Python example:
driver.capabilities['browserVersion']

How to test multiple version of google chrome using chromedriver?

selenium web-driver with java then how to use chrome driver for test their lower version of Google chrome
From the official wiki page:
Overriding the Chrome binary location
You can specify the location of the Chrome binary by passing the "chrome.binary" capability, e.g. with a typical Chromium install on Debian:
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.binary", "/usr/lib/chromium-browser/chromium-browser");
WebDriver driver = new ChromeDriver(capabilities);
I suggest you try this approach - tell where the binary of lower version is and start ChromeDriver. Never tried it, but I think it might work
You would use capabilities to point to the right binary file of the browser to be launced.But not all versions of chrome browser is supported by different versions of chromedriver. You will find exceptions stating that version of browser expected is greater or equal to 30.0.
For ex:- Chromium Browser(33.0.1729.0 )works fine with ChromeDriver 2.7 and not the with the older ones.
You can choose from all the chromedriver version available from the link below:-
http://chromedriver.storage.googleapis.com/index.html
Install chrome to custom location, be sure to turn off auto-update. Use following code to use non-default binary.
ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/binary");
DesiredCapabilities desiredCapabilities = DesiredCapabilities.chrome();
desiredCapabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver webDriver = new ChromeDriver(desiredCapabilities);