Suriya Rakhunathan February 2016

Selenium WebDriver + Firefox which version works fine?

I am working on writing an automation script to test a website login. Through Firefox IDE, I have written TestCase steps, it is executing fine. I exported the test case as java code compatible with jUnit 4.

When i try to run the java code via Eclipse (with firefox browser), either it opens Mozilla homepage or blank page or proxy issue (if my machine is connected to company LAN).

I am using Selenium 2.44 and Firefox version 44.. Also i read in some websites saying about compatible version of firefox with selenium web driver. I am confused a lot regarding this.

Please let me know which version of Selenium Web driver, Firefox & Java is preferred..!!!

Adding my java code below

public class Firefox {
private WebDriver driver;
private String PROXY = "proxy address:port";
private String baseUrl;
private boolean acceptNextAlert = true;
@Before
public void setUp() throws Exception {
// Code for setting up Firefox proxy
Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(PROXY)
.setFtpProxy(PROXY)
.setSslProxy(PROXY);
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PROXY, proxy);
driver = new FirefoxDriver(cap);
baseUrl = "url";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testFirefox() throws Exception {
driver.get(baseUrl);
for (int second = 0;; second++) {
if (second >= 60) fail("timeout");
try { 
if ("".equals(driver.findElement(By.id("userId")).getText())) break; 
}
catch (Exception e) {}
Thread.sleep(1000);
}
driver.findElement(By.id("userId")).sendKeys("user name");
driver.findElement(By.id("pwd")).sendKeys("password");
driver.findElement(By.id("sign-in")).click();
}
}

Answers


Mrunal Gosar February 2016

Latest stable compatible configuration which i've found and I am using it is selenium Webdriver 2.48.2 and Firefox 41.0.2


Saganowsky February 2016

Download Firefox ESR from https://www.mozilla.org/en-US/firefox/organizations/all/

Its stable version browser of Firefox compatible with Webdriver 2.48.2. Selenium WebDriver 2.48.2 will not work with FF 44.


djangofan February 2016

The latest Firefox always works with the latest version of Selenium (2.x versions) for all non-native events, such as JavascriptExecutor events, but there are some native events (such as driver.navigate.to() and driver.click() that won't work except with the last known native supported version of Firefox, which was 31.6.0 ESR. It's possible that later versions of ESR will work, but I have not read that anywhere.

Post Status

Asked in February 2016
Viewed 1,809 times
Voted 12
Answered 3 times

Search




Leave an answer