Search in sources :

Example 1 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project ghostdriver by detro.

the class BaseTest method prepareDriver.

@Before
public void prepareDriver() throws Exception {
    // Which driver to use? (default "phantomjs")
    String driver = sConfig.getProperty("driver", DRIVER_PHANTOMJS);
    // Start appropriate Driver
    if (isUrl(driver)) {
        sCaps.setBrowserName("phantomjs");
        mDriver = new RemoteWebDriver(new URL(driver), sCaps);
    } else if (driver.equals(DRIVER_FIREFOX)) {
        mDriver = new FirefoxDriver(sCaps);
    } else if (driver.equals(DRIVER_CHROME)) {
        mDriver = new ChromeDriver(sCaps);
    } else if (driver.equals(DRIVER_PHANTOMJS)) {
        mDriver = new PhantomJSDriver(sCaps);
    }
}
Also used : PhantomJSDriver(org.openqa.selenium.phantomjs.PhantomJSDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) ChromeDriver(org.openqa.selenium.chrome.ChromeDriver) URL(java.net.URL) Before(org.junit.Before)

Example 2 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project violations-plugin by jenkinsci.

the class ConfigurationWebTest method before.

@BeforeClass
public static void before() throws Exception {
    webDriver = new FirefoxDriver();
    waitForJenkinsToStart();
}
Also used : FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) BeforeClass(org.junit.BeforeClass)

Example 3 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project head by mifos.

the class SeleniumTest method testSearchMifosOnGoogle.

@Test
public void testSearchMifosOnGoogle() throws Exception {
    WebDriver wd = new FirefoxDriver();
    try {
        wd.get("http://www.google.com");
        WebElement element = wd.findElement(By.name("q"));
        element.sendKeys("Mifos");
        element.submit();
    } finally {
        wd.quit();
    }
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) WebElement(org.openqa.selenium.WebElement) Test(org.junit.Test)

Example 4 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project head by mifos.

the class WorkspaceServerLauncherTest method testLogin.

@Test
public void testLogin() throws Exception {
    WebDriver wd = new FirefoxDriver();
    wd.get(getAppURL());
    wd.findElement(By.id(UID)).sendKeys("mifos");
    wd.findElement(By.id(PWD)).sendKeys("testmifos");
    wd.findElement(By.id(BTN)).click();
    Assert.assertTrue(wd.getPageSource().contains("Mifos"));
    Assert.assertTrue(wd.getPageSource().contains("Home"));
    Assert.assertTrue(wd.getPageSource().contains("Search"));
    wd.quit();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Test(org.junit.Test)

Example 5 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project head by mifos.

the class MifosPackagedWARBasicTest method testPackagedWARStartup.

@Test
public void testPackagedWARStartup() throws Exception {
    WARServerLauncher serverLauncher = mifosLauncher(7077);
    serverLauncher.startServer();
    WebDriver wd = new FirefoxDriver();
    wd.get("http://localhost:7077/mifos/");
    wd.findElement(By.id("login.input.username")).sendKeys("mifos");
    wd.findElement(By.id("login.input.password")).sendKeys("testmifos");
    wd.findElement(By.id("login.button.login")).click();
    Assert.assertTrue(wd.getPageSource().contains("Mifos"));
    Assert.assertTrue(wd.getPageSource().contains("Home"));
    Assert.assertTrue(wd.getPageSource().contains("Search"));
    wd.quit();
    serverLauncher.stopServer();
    serverLauncher = null;
}
Also used : WebDriver(org.openqa.selenium.WebDriver) WARServerLauncher(org.mifos.server.WARServerLauncher) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Test(org.junit.Test)

Aggregations

FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)77 WebDriver (org.openqa.selenium.WebDriver)59 WebElement (org.openqa.selenium.WebElement)46 Actions (org.openqa.selenium.interactions.Actions)18 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)9 File (java.io.File)8 FirefoxBinary (org.openqa.selenium.firefox.FirefoxBinary)5 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)5 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)4 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)4 URL (java.net.URL)3 Before (org.junit.Before)3 Test (org.junit.Test)3 PublicAtsApi (com.axway.ats.common.PublicAtsApi)2 FileReader (java.io.FileReader)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 BeforeClass (org.junit.BeforeClass)2 Cookie (org.openqa.selenium.Cookie)2