Examples of FirefoxBinary


Examples of org.openqa.selenium.firefox.FirefoxBinary

    protected void setupLocalDriver(DesiredCapabilities desiredCapabilities) {
        WebDriver driver;
        if (BrowserUtil.isFirefox(desiredCapabilities)) {
            String firefoxPath = getProperty("firefox.path");
            if (firefoxPath != null) {
                driver = new FirefoxDriver(new FirefoxBinary(new File(
                        firefoxPath)), null);
            } else {
                driver = new FirefoxDriver();
            }
        } else if (BrowserUtil.isChrome(desiredCapabilities)) {
View Full Code Here

Examples of org.openqa.selenium.firefox.FirefoxBinary

        }
        // only binary was specified
        else if (Validate.empty(profile)) {
            Validate.isExecutable(binary, "Firefox binary does not point to a valid executable,  " + binary);
            return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { FirefoxBinary.class,
                    FirefoxProfile.class }, new Object[] { new FirefoxBinary(new File(binary)), null }, FirefoxDriver.class);
        }
        // only profile was specified
        else if (Validate.empty(binary)) {
            Validate.isValidPath(profile, "Firefox profile does not point to a valid path " + profile);

            return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { FirefoxProfile.class },
                    new Object[] { new FirefoxProfile(new File(profile)) }, FirefoxDriver.class);
        }
        // both were specified
        else {
            Validate.isValidPath(profile, "Firefox profile does not point to a valid path,  " + profile);
            Validate.isExecutable(binary, "Firefox binary does not point to a valid executable,  " + binary);

            return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { FirefoxBinary.class,
                    FirefoxProfile.class }, new Object[] { new FirefoxBinary(new File(binary)),
                    new FirefoxProfile(new File(profile)) }, FirefoxDriver.class);
        }
    }
View Full Code Here

Examples of org.openqa.selenium.firefox.FirefoxBinary

  private static FirefoxDriver initDriver() {
    File torProfileDir
        = new File(torbrowserHome + File.separator + "Data" + File.separator +
        "Browser" + File.separator + "profile.default");
    FirefoxBinary binary = new FirefoxBinary(new File(torbrowserHome + File.separator + "Start Tor Browser.exe"));
    FirefoxProfile torProfile = new FirefoxProfile(torProfileDir);
    torProfile.setPreference("webdriver.load.strategy", "unstable");

    try {
      binary.startProfile(torProfile, torProfileDir, "");
    } catch (IOException e) {
      e.printStackTrace();
    }

    FirefoxProfile profile = new FirefoxProfile();
View Full Code Here

Examples of org.openqa.selenium.firefox.FirefoxBinary

        return profile;
    }

    @Override
    protected FirefoxDriver createBrowser() {
        return new FirefoxDriver(new FirefoxBinary(), createProfile(), createCapabilities());
    }
View Full Code Here

Examples of org.openqa.selenium.firefox.FirefoxBinary

            }
            if (driverOptions.has(CLI_ARGS))
                log.warn("Ignore --cli-args with RemoteWebDriver.");
            return;
        }
        FirefoxBinary binary;
        try {
            if (firefoxBin != null) {
                File file = new File(firefoxBin);
                if (!file.isFile() || !file.canExecute())
                    throw new IllegalArgumentException("Missing Firefox binary: " + firefoxBin);
                binary = new FirefoxBinary(file);
                log.info("Firefox binary: {}", firefoxBin);
            } else {
                binary = new FirefoxBinary();
            }
        } catch (WebDriverException e) {
            throw new IllegalArgumentException(e.getMessage(), e);
        }
        if (driverOptions.has(CLI_ARGS)) {
            String[] cliArgs = driverOptions.getCliArgs();
            binary.addCommandLineOptions(cliArgs);
            log.info("Command line arguments: [{}]", StringUtils.join(cliArgs, "] ["));
        }
        boolean isFirst = true;
        for (Map.Entry<String, String> entry : driverOptions.getEnvVars().entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();
            binary.setEnvironmentProperty(key, value);
            if (isFirst) {
                log.info("Envrionment variables:");
                isFirst = false;
            }
            log.info("- [{}]=[{}]", key, StringEscapeUtils.escapeJava(value));
View Full Code Here

Examples of org.openqa.selenium.firefox.FirefoxBinary

    public static final String FIREFOX_PROFILE = "JBEHAVE_WEBDRIVER_FIREFOX_PROFILE";
    public static final Map<Integer,Long> driverToThreadMap = new HashMap<Integer,Long>(11);
    public void initialize() {
        String profileName = System.getProperty(FIREFOX_PROFILE);
        final FirefoxBinary binary = new FirefoxBinary();
        decorateFirefoxBinary(binary);
        OverriddenFirefoxDriver firefoxDriver = null;
        if (profileName != null) {
            ProfilesIni allProfilesIni = new ProfilesIni();
            FirefoxProfile profile = allProfilesIni.getProfile(profileName);
View Full Code Here

Examples of org.openqa.selenium.firefox.FirefoxBinary

   */
  @Before
  public void setUp() throws Exception {

    profile = new FirefoxProfile();
    driver = new FirefoxDriver(new FirefoxBinary(new File(
        "D:/Programme/Mozilla Firefox/firefox.exe")), profile);
    driver.get("http://localhost:8080/archivator/faces/index.xhtml");
    driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
    WebElement query = driver.findElement(By
        .xpath("//input[@type='password']"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.