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.example.selenium.working.with.elements.WebElementsTest.java

@BeforeTest
public void setUp() {
    driver = new FirefoxDriver();
}

From source file:com.example.tests.SignUp.java

@Before
public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "http://usab-staging.weboapps.com/";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

From source file:com.example.webvaadin.WebvaadinTest.java

License:Open Source License

@Before
public void setUp() throws Exception {
    setDriver(new FirefoxDriver()); // Firefox

    // To use Chrome, first install chromedriver.exe from
    // http://chromedriver.storage.googleapis.com/index.html
    // on your system path (e.g. C:\Windows\System32\)
    //   setDriver(new ChromeDriver());   // Chrome

    // To use Internet Explorer, first install iedriverserver.exe from
    // http://selenium-release.storage.googleapis.com/index.html?path=2.43/
    // on your system path (e.g. C:\Windows\System32\)
    //   setDriver(new InternetExplorerDriver()); // IE

    // To test headlessly (without a browser), first install phantomjs.exe
    // from http://phantomjs.org/download.html on your system path
    // (e.g. C:\Windows\System32\)
    //   setDriver(new PhantomJSDriver()); // PhantomJS headless browser
}

From source file:com.facebook.TestClass.java

@Test
public void test() {
    driver = new FirefoxDriver();
    driver.get("http://facebook.com");
    try {/*  www  . j  av  a  2 s.c  om*/
        Thread.sleep(3000);
    } catch (InterruptedException ex) {
        Logger.getLogger(TestClass.class.getName()).log(Level.SEVERE, null, ex);
    }
    driver.quit();
}

From source file:com.fireblade.WebDriver.WebDriverFactory.java

public WebDriver createDriver(String driverType) {
    switch (driverType) {
    case "HtmlUnitDriver":
        driver = new HtmlUnitDriver();
        break;// w  w w  .j  av a  2  s  . co  m
    case "FirefoxDriver":
        driver = new FirefoxDriver();
        break;
    }
    return driver;
}

From source file:com.fmb.common.BrowserEmulator.java

License:Apache License

private void setupBrowserCoreType(int type) {
    if (type == 1) {
        browserCore = new FirefoxDriver();
        logger.info("Using Firefox");
        return;//from w  w  w.j  a va2 s .co m
    }
    if (type == 2) {
        chromeServer = new ChromeDriverService.Builder()
                .usingDriverExecutable(new File(GlobalSettings.chromeDriverPath)).usingAnyFreePort().build();
        try {
            chromeServer.start();
        } catch (IOException e) {
            e.printStackTrace();
        }
        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        capabilities.setCapability("chrome.switches", Arrays.asList("--start-maximized"));
        browserCore = new RemoteWebDriver(chromeServer.getUrl(), capabilities);
        logger.info("Using Chrome");
        return;
    }
    if (type == 3) {
        System.setProperty("webdriver.ie.driver", GlobalSettings.ieDriverPath);
        DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
        capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
                true);
        browserCore = new InternetExplorerDriver(capabilities);
        logger.info("Using IE");
        return;
    }
    if (type == 4) {
        browserCore = new SafariDriver();
        logger.info("Using Safari");
        return;
    }

    Assert.fail("Incorrect browser type");
}

From source file:com.galenframework.ide.tests.integration.ui.WebDriverSingleInstance.java

License:Apache License

public synchronized static WebDriver getDriver() {
    if (_instance == null) {
        _instance = new FirefoxDriver();
    }//from ww w  . java 2s .c o m
    return _instance;
}

From source file:com.galenframework.testng.GalenTestNgTestBaseIT.java

License:Apache License

@Override
public WebDriver createDriver(Object[] args) {
    return new FirefoxDriver();
}

From source file:com.galenframework.tests.integration.ComponentFrameIT.java

License:Apache License

@BeforeMethod
public void createDriver() {
    driver = new FirefoxDriver();
    driver.get(toFileProtocol(getClass().getResource("/frame-page/main.html").getPath()));
    driver.manage().window().setSize(new Dimension(1024, 768));
}

From source file:com.galenframework.tests.integration.GalenPagesIT.java

License:Apache License

@BeforeClass
public void initDriver() {
    driver = new FirefoxDriver();
}