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());
}
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);
}
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);
}
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);
}
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());
}
}
Aggregations