java - Selenium WebDriver + Firefox which version works fine? -
i working on writing automation script test website login. through firefox ide, have written testcase steps, executing fine. exported test case java code compatible junit 4.
when try run java code via eclipse (with firefox browser), either opens mozilla homepage or blank page or proxy issue (if machine connected company lan).
i using selenium 2.44 , firefox version 44.. read in websites saying compatible version of firefox selenium web driver. confused lot regarding this.
please let me know version of selenium web driver, firefox & java preferred..!!!
adding 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 setting 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); (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(); } }
latest stable compatible configuration i've found , using selenium webdriver 2.48.2 , firefox 41.0.2
Comments
Post a Comment