Search in sources :

Example 26 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.

the class GetSize method main.

public static void main(String[] args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("http://www.google.com");
    WebElement searchButton = driver.findElement(By.name("btnK"));
    System.out.println(searchButton.getSize());
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) WebElement(org.openqa.selenium.WebElement)

Example 27 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project gitblit by gitblit.

the class AbstractUITest method setUpClass.

/**
	 * starts a gitblit server instance in a separate thread before test cases
	 * of concrete, non-abstract child-classes are executed
	 */
@BeforeClass
public static void setUpClass() {
    Runnable gitblitRunnable = new GitblitRunnable(HTTP_PORT, HTTPS_PORT, SHUTDOWN_PORT, GITBLIT_PROPERTIES_PATH, USERS_PROPERTIES_PATH);
    serverThread = new Thread(gitblitRunnable);
    serverThread.start();
    FirefoxProfile firefoxProfile = new FirefoxProfile();
    firefoxProfile.setPreference("startup.homepage_welcome_url", "https://www.google.de");
    firefoxProfile.setPreference("browser.download.folderList", 2);
    firefoxProfile.setPreference("browser.download.manager.showWhenStarting", false);
    String downloadDir = System.getProperty("java.io.tmpdir");
    firefoxProfile.setPreference("browser.download.dir", downloadDir);
    firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv,text/plain,application/zip,application/pdf");
    firefoxProfile.setPreference("browser.helperApps.alwaysAsk.force", false);
    System.out.println("Saving all attachments to: " + downloadDir);
    driver = new FirefoxDriver(firefoxProfile);
}
Also used : FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) GitblitRunnable(de.akquinet.devops.GitblitRunnable) FirefoxProfile(org.openqa.selenium.firefox.FirefoxProfile) GitblitRunnable(de.akquinet.devops.GitblitRunnable) BeforeClass(org.junit.BeforeClass)

Example 28 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project opennms by OpenNMS.

the class OpennmsSeleniumExample method setUp.

@Before
public void setUp() throws Exception {
    System.err.println("Before is being called in Groovy Script: " + this.hashCode());
    driver = new FirefoxDriver();
    driver.manage().timeouts().implicitlyWait(timeout, TimeUnit.SECONDS);
}
Also used : FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Before(org.junit.Before)

Example 29 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project selenium-tests by Wikia.

the class FirefoxBrowser method create.

@Override
public WikiaWebDriver create() {
    caps.setCapability(FirefoxDriver.PROFILE, firefoxProfile);
    caps.setCapability("marionette", true);
    return new WikiaWebDriver(new FirefoxDriver(caps), server, false);
}
Also used : WikiaWebDriver(com.wikia.webdriver.common.core.WikiaWebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver)

Example 30 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project Asqatasun by Asqatasun.

the class AbstractWebDriverTestClass method initialize.

/**
     *
     */
private void initialize() {
    // Mysql access parameters are passed as JVM argument
    //        dbUrl = System.getProperty(DB_URL_KEY);
    //        dbName = System.getProperty(DB_NAME_KEY);
    //        dbUser = System.getProperty(DB_USER_KEY);
    //        dbPassword = System.getProperty(DB_PASSWORD_KEY);
    //        initDb();
    // These parameters has to passed as JVM argument
    user = System.getProperty(USER_KEY);
    password = System.getProperty(PASSWORD_KEY);
    hostLocation = System.getProperty(HOST_LOCATION_KEY);
    xvfbDisplay = System.getProperty(XVFB_DISPLAY_KEY);
    pathToFirefox = System.getProperty(FIREFOX_PATH_KEY);
    //        createRootUserInDb();
    ResourceBundle parametersBundle = ResourceBundle.getBundle(BUNDLE_NAME);
    userFieldName = parametersBundle.getString(USER_FIELD_NAME_KEY);
    passwordFieldName = parametersBundle.getString(PASSWORD_FIELD_NAME_KEY);
    loginUrl = hostLocation + parametersBundle.getString(LOGIN_URL_KEY);
    logoutUrl = hostLocation + parametersBundle.getString(LOGOUT_URL_KEY);
    adminUrl = hostLocation + parametersBundle.getString(ADMIN_URL_KEY);
    addUserUrl = hostLocation + parametersBundle.getString(ADD_USER_URL_KEY);
    editUserUrl = hostLocation + parametersBundle.getString(EDIT_USER_URL_KEY);
    deleteUserUrl = hostLocation + parametersBundle.getString(DELETE_USER_URL_KEY);
    addContractUrl = hostLocation + parametersBundle.getString(ADD_CONTRACT_URL_KEY);
    contractUrl = hostLocation + parametersBundle.getString(CONTRACT_URL_KEY);
    auditPagesSetupUrl = hostLocation + parametersBundle.getString(AUDIT_PAGES_URL_KEY);
    auditSiteSetupUrl = hostLocation + parametersBundle.getString(AUDIT_SITE_URL_KEY);
    auditUploadSetupUrl = hostLocation + parametersBundle.getString(AUDIT_UPLOAD_URL_KEY);
    auditScenarioSetupUrl = hostLocation + parametersBundle.getString(AUDIT_SCENARIO_URL_KEY);
    addUserContractUrl = hostLocation + parametersBundle.getString(ADD_USER_CONTRACT_URL_KEY);
    editUserContractUrl = hostLocation + parametersBundle.getString(EDIT_USER_CONTRACT_URL_KEY);
    if (driver == null) {
        FirefoxBinary ffBinary = new FirefoxBinary(new File(pathToFirefox));
        if (xvfbDisplay != null) {
            Logger.getLogger(this.getClass()).info("Setting Xvfb display with value " + xvfbDisplay);
            ffBinary.setEnvironmentProperty("DISPLAY", xvfbDisplay);
        }
        driver = new FirefoxDriver(ffBinary, new FirefoxProfile());
    }
}
Also used : FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) FirefoxBinary(org.openqa.selenium.firefox.FirefoxBinary) ResourceBundle(java.util.ResourceBundle) FirefoxProfile(org.openqa.selenium.firefox.FirefoxProfile) File(java.io.File)

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