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();
Related
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.
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());
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);
}
}
Which Firefox version is compatible with Selenium 2.53.0? I tried Firefox 45.0 and I am getting this exception:
org.openqa.selenium.WebDriverException: Failed to connect to binary
FirefoxBinary(/Applications/Firefox.app/Contents/MacOS/firefox-bin) on port 7055; process output follows:
foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":false,"l ocales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"45.0","maxVersion":"45.*"},{"id":"xpcshell#tests.mozilla.org","minVersion":"0","maxVersion":"10"}],"targetPlatforms":[],"multiprocessCompatible":false,"seen":true}
I had the similar problem running Selenium Webdriver 2.53.0 with Firefox 47.0.
Selenium Webdriver 2.53.0 works with Firefox 46.0. You can find the the mentioned version at https://support.mozilla.org/en-US/kb/install-older-version-of-firefox.
Also you could try to add:
System.setProperty("webdriver.firefox.bin","C:\\Users\\AppData\\Local\\Mozilla Firefox\\firefox.exe");
WebDriver driver=new FirefoxDriver();
if it is also not working, then you need to downgrade your FF
hi I had the same problem, I hope you have solved yours, but maybe my answer can help someone else.
i found firefox 26, selenium 2.48.2 and a webdriver that work very good together. here are the download links:
phpSeleniumWebDrive
selenium-server-standalone-2.48.2
firefox26
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']