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.galenframework.util.DriverTestFactory.java

License:Apache License

/**
 * Instantiate a new WebDriver instance, respects GalenConfig
 * /*from   w  ww.j  a v  a 2 s.  c o m*/
 * @see GalenConfig
 * @return a new instance of the desired WebDriver
 */
public static WebDriver getDriver() {
    WebDriver driver = null;
    if (StringUtils.equalsIgnoreCase(GalenConfig.getConfig().getDefaultBrowser(), "chrome")) {
        driver = new ChromeDriver();
    } else {
        if (StringUtils.equalsIgnoreCase(GalenConfig.getConfig().getDefaultBrowser(), "safari")) {
            driver = new SafariDriver();
        } else {
            if (StringUtils.equalsIgnoreCase(GalenConfig.getConfig().getDefaultBrowser(), "iexplore")) {
                driver = new InternetExplorerDriver();
            } else {
                // default to firefox
                driver = new FirefoxDriver();
            }
        }
    }
    return driver;
}

From source file:com.gdf.managedBean.ContractorInformationTest.java

@BeforeClass
public static void setUpClass() {

    driver = new FirefoxDriver();
    baseUrl = "http://localhost:8080/Oops-web/views/contractorInformations.xhtml";
    driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);

}

From source file:com.gdf.managedBean.TendererEditBeanTest.java

@BeforeClass
public static void setUpClass() {

    driver = new FirefoxDriver();
    baseUrl = "http://localhost:8080/Oops-web/views/tendererManagement.xhtml";
    driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);

}

From source file:com.gdf.managedBean.TendererRegistrationBeanTest.java

@BeforeClass
public static void setUpClass() {
    driver = new FirefoxDriver();
    baseUrl = "http://localhost:8080/Oops-web/views/tendererRegistration.xhtml";
    driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
}

From source file:com.gedaeusp.selenium.AnaerobicLacticTest.java

License:Open Source License

@Before
public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = Defines.getDomain();/*from  w ww.  ja v a  2 s. co m*/
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

From source file:com.gedaeusp.selenium.Sel6.java

License:Open Source License

@Before
public void setUp() throws Exception {
    driver = new FirefoxDriver();
    Dimension resolution = new Dimension(1280, 1024);
    driver.manage().window().setSize(resolution);
    baseUrl = Defines.getDomain();/*w w  w. ja v a  2  s  .c  om*/
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

From source file:com.github.ccaspanello.selenium.example.integration.framework.WebDriverFactory.java

License:Apache License

public static WebDriver create(String browser) {
    if (browser.equalsIgnoreCase("firefox")) {
        return new FirefoxDriver();
    } else if (browser.equalsIgnoreCase("chrome")) {
        return new ChromeDriver();
    } else if (browser.equalsIgnoreCase("ie")) {
        return new InternetExplorerDriver();
    } else if (browser.equalsIgnoreCase("safari")) {
        return new SafariDriver();
    } else if (browser.equalsIgnoreCase("html")) {
        HtmlUnitDriver htmlUnitDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX_38);
        htmlUnitDriver.setJavascriptEnabled(true);
        return htmlUnitDriver;
    } else {/*from   w ww .  j av  a 2s.co m*/
        throw new IllegalArgumentException("The Browser Type is Undefined");
    }
}

From source file:com.github.dactiv.common.unit.selenium.WebDriverFactory.java

License:Apache License

/**
 * ?driverName??WebDriver.//from   www.  j  a  va  2 s . co  m
 * 
 * ??firefox,ie,chrome??.
 * 
 * ????Windows, IE?XWindows, ???remote driverWindows.
 * drivernameremote:192.168.0.2:4444:firefox, ??http://192.168.0.2:4444/wd/hub?selenium remote?.
 */
public static WebDriver createDriver(String driverName) {
    WebDriver driver = null;

    if (BrowserType.firefox.name().equals(driverName)) {
        driver = new FirefoxDriver();
    } else if (BrowserType.ie.name().equals(driverName)) {
        driver = new InternetExplorerDriver();
    } else if (BrowserType.chrome.name().equals(driverName)) {
        driver = new ChromeDriver();
    } else if (driverName.startsWith(BrowserType.remote.name())) {
        String[] params = driverName.split(":");
        Assert.isTrue(params.length == 4,
                "Remote driver is not right, accept format is \"remote:localhost:4444:firefox\", but the input is\""
                        + driverName + "\"");

        String remoteHost = params[1];
        String remotePort = params[2];
        String driverType = params[3];

        String remoteUrl = "http://" + remoteHost + ":" + remotePort + "/wd/hub";

        DesiredCapabilities cap = null;
        if (BrowserType.firefox.name().equals(driverType)) {
            cap = DesiredCapabilities.firefox();
        } else if (BrowserType.ie.name().equals(driverType)) {
            cap = DesiredCapabilities.internetExplorer();
        } else if (BrowserType.chrome.name().equals(driverType)) {
            cap = DesiredCapabilities.chrome();
        }

        try {
            driver = new RemoteWebDriver(new URL(remoteUrl), cap);
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }

    Assert.notNull(driver, "Driver could be found by name:" + driverName);

    return driver;
}

From source file:com.github.iexel.fontus.web.test.SeleniumIT.java

License:Apache License

@Before
public void setUp() throws Exception {

    // System.setProperty("webdriver.chrome.driver", "/home/user/chromedriver");
    // driver = new ChromeDriver();

    driver = new FirefoxDriver();

    baseUrl = "http://localhost:8080/fontus-web";
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    driver.manage().window().maximize();
}

From source file:com.github.lucasgueiros.whist.partida.PartidaWebIT.java

@BeforeClass // (alwaysRun = true)
public static void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "http://localhost:8080";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}