Example usage for org.openqa.selenium.firefox FirefoxDriver FirefoxDriver

List of usage examples for org.openqa.selenium.firefox FirefoxDriver FirefoxDriver

Introduction

In this page you can find the example usage for org.openqa.selenium.firefox FirefoxDriver FirefoxDriver.

Prototype

public FirefoxDriver() 

Source Link

Usage

From source file:com.springer.omelet.driver.DriverFactory.java

License:Apache License

/***
 * Return WebDriver either Remote/BrowserStack or local Browser based on
 * remoteFlag//  ww  w .  j a  v a2s.  c  o  m
 * 
 * @return
 */
public WebDriver intializeDriver() {

    if (remoteFlag) {
        RemoteBrowser rb = this.new RemoteBrowser();
        webDriver = rb.returnRemoteDriver();
    } else if (browser.toLowerCase().startsWith("f")) {
        LOGGER.debug("Returning firefox driver-Without Remote.");
        webDriver = new FirefoxDriver();
    } else if (browser.toLowerCase().startsWith("i")) {
        System.setProperty("webdriver.ie.driver", ieServerPath);
        LOGGER.debug("Returning ie driver-Without Remote.");
        webDriver = new InternetExplorerDriver();
    } else if (browser.toLowerCase().startsWith("c")) {
        System.setProperty("webdriver.chrome.driver", chromeServerPath);
        LOGGER.debug("Returning chrome driver-Without Remote.");
        webDriver = new ChromeDriver();
    } else if (browser.toLowerCase().startsWith("h")) {
        LOGGER.info("Browser is HTMLUNIT");
        webDriver = new HtmlUnitDriver();
    }

    // For maximizing driver windows and wait
    if (webDriver != null) {
        if (this.isMobileTest == false) {
            webDriver.manage().window().maximize();
        }
        webDriver.manage().timeouts().implicitlyWait(driverTimeOut, TimeUnit.SECONDS);
    }

    if (ishiglightElementFlag) {
        EventFiringWebDriver efw = new EventFiringWebDriver(webDriver);
        efw.register(new MyWebDriverListner());
        webDriver = efw;
    }
    return webDriver;

}

From source file:com.steps.deviantarttestproject.Steps.java

public void initBrowser() {
    driver = new FirefoxDriver();
    driver.manage().timeouts().pageLoadTimeout(500, TimeUnit.SECONDS);
    driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
    logger.info("Browser started");
}

From source file:com.synapticpath.naica.TestRun.java

License:Open Source License

@Test
public void runTest() {

    TestProperties props = getTestProperties();

    FirefoxDriver driver = new FirefoxDriver();
    SeleniumTestContext context = SeleniumTestContext.getInstance();
    context.setDriver(driver);/*from   w  w  w  . j  a  v  a  2 s .  c o  m*/
    context.setProperties(props);

    createRunner().run();

    assertFalse(context.isFailed());
}

From source file:com.sysco.test.leadAutomationTestDeveloper.java

@BeforeClass
public void initDriver() {
    driver = new FirefoxDriver();
    baseUrl = "http://www.sysco.com/";
    driver.manage().window().maximize();
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}

From source file:com.thomas.domain.testcases.VerifyTopNavlnks.java

@BeforeMethod
public void setup() {

    driver = new FirefoxDriver();
    driver.get(baseurl);

}

From source file:com.thoughtworks.twist.driver.WebDriverClient.java

License:Apache License

public WebDriver getFirefoxDriver(String firefox_bin) {
    if (driver == null) {
        if (CruiseConstants.WEBDRIVER_TESTS.equals("Y")) {
            System.setProperty("webdriver.firefox.bin", firefox_bin);
            driver = new FirefoxDriver();
        }//from  w  w w  .  j a  v a2  s.c om
    }
    return driver;
}

From source file:com.tractionsoftware.reshoot.util.TractionWebdriverUtils.java

License:Apache License

public static FirefoxDriver createFirefoxDriver() {
    return new FirefoxDriver();
}

From source file:com.tricentis.automobileinsurance.utility.AutomobileUtil.java

/**
 * /*w  w  w  .  ja  v a 2s  .  com*/
 * @param browserName
 */
public void setEnvironment(String browserName) {
    if (browserName.equalsIgnoreCase("firefox")) {
        /*Open firefox browser*/
        System.setProperty(AutomobileConstant.FIREFOXDRIVER_KEY, AutomobileConstant.FIREFOXDRIVER_VALUE);
        driver = new FirefoxDriver();
    } else if (browserName.equalsIgnoreCase("chrome")) {
        System.setProperty(AutomobileConstant.CHROMEDRIVER_KEY, AutomobileConstant.CHROMEDRIVER_VALUE);
        driver = new ChromeDriver();
    } else {
        System.setProperty(AutomobileConstant.IEDRIVER_KEY, AutomobileConstant.IEDRIVER_VALUE);
        driver = new InternetExplorerDriver();
    }
    /*implicit wait*/
    driver.manage().timeouts().implicitlyWait(AutomobileConstant.IMPLICIT_WAIT, TimeUnit.SECONDS);
    /*maximize browser window*/
    driver.manage().window().maximize();
    /* hit the application URL*/
    driver.get(AutomobileConstant.APPLICATION_URL);
    action = new Actions(driver);
}

From source file:com.urlisit.siteswrapper.srs.gae.SitesWrapper_GAE_1.java

License:Apache License

@Before
public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "https://accounts.google.com/";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    String adminPasswd = SitesWrapper.getAdministratorPasswd();
}

From source file:com.urlisit.siteswrapper.srs.gas.SitesWrapper_GAS_1.java

License:Apache License

private void startDriver() {
    driver = new FirefoxDriver();
    baseUrl = SitesWrapper.GOOGLE_ACCOUNTS_URL;
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}