Package org.openqa.selenium.firefox

Examples of org.openqa.selenium.firefox.FirefoxProfile


      WebDriverRunner.closeWebDriver();
    }
  }

  private FirefoxProfile createFirefoxProfileWithExtensions() {
    FirefoxProfile profile = new FirefoxProfile();
    try {
      profile.addExtension(new File(currentThread().getContextClassLoader().getResource("firebug-1.11.4.xpi").getPath()));
      profile.addExtension(new File(currentThread().getContextClassLoader().getResource("firepath-0.9.7-fx.xpi").getPath()));
      profile.setPreference("extensions.firebug.showFirstRunPage", false);
      profile.setPreference("extensions.firebug.allPagesActivation", "on");
    } catch (IOException e) {
      throw new IllegalStateException(e);
    }
    profile.setEnableNativeEvents(true);
    profile.setPreference("intl.accept_languages", "no,en-us,en");
    profile.setPreference("extensions.firebug.console.enableSites", "true");
    return profile;
  }
View Full Code Here


        enhancer.enhanceCapabilities(capabilities);
        return webdriverInstanceFactory.newPhantomDriver(enhancedCapabilities(capabilities));
    }

    private WebDriver firefoxDriver() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
        FirefoxProfile profile = buildFirefoxProfile();
        DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        capabilities.setCapability(FirefoxDriver.PROFILE, profile);
        return webdriverInstanceFactory.newFirefoxDriver(enhancedCapabilities(capabilities));
    }
View Full Code Here

        return (PhantomJSDriver.class.isAssignableFrom(getDriverClass(driver)));
    }


    protected FirefoxProfile createNewFirefoxProfile() {
        FirefoxProfile profile;
        if (Thucydides.getFirefoxProfile() != null) {
            profile = Thucydides.getFirefoxProfile();
        } else {
            profile = new FirefoxProfile();
            profile.setPreference("network.proxy.socks_port",9999);
            profile.setAlwaysLoadNoFocusLib(true);
            profile.setEnableNativeEvents(true);
        }
        return profile;
    }
View Full Code Here

        }
        return profile;
    }

    protected FirefoxProfile useExistingFirefoxProfile(final File profileDirectory) {
        return new FirefoxProfile(profileDirectory);
    }
View Full Code Here

        if (StringUtils.isNotEmpty(profileName)) {
            firefoxCapabilities.setCapability(FirefoxDriver.PROFILE, parser.getInstanciatedPath(profileName));
        }


        FirefoxProfile profile;
        if (profileName == null) {
            profile = createNewFirefoxProfile();
        } else {
            profile = getProfileFrom(profileName);
        }

        firefoxProfileEnhancer.allowWindowResizeFor(profile);
        firefoxProfileEnhancer.activateNativeEventsFor(profile, shouldEnableNativeEvents());
        if (shouldActivateProxy()) {
            activateProxyFor(profile, firefoxProfileEnhancer);
        }
        if (firefoxProfileEnhancer.shouldActivateFirebugs()) {
            firefoxProfileEnhancer.addFirebugsTo(profile);
        }
        if (refuseUntrustedCertificates()) {
            profile.setAssumeUntrustedCertificateIssuer(false);
            profile.setAcceptUntrustedCertificates(false);
        } else {
            profile.setAssumeUntrustedCertificateIssuer(true);
            profile.setAcceptUntrustedCertificates(true);
        }
        firefoxProfileEnhancer.configureJavaSupport(profile);
        firefoxProfileEnhancer.addPreferences(profile);
        return profile;
    }
View Full Code Here

    private String getProxyUrlFromEnvironmentVariables() {
        return environmentVariables.getProperty(ThucydidesSystemProperty.THUCYDIDES_PROXY_HTTP.getPropertyName());
    }

    private FirefoxProfile getProfileFrom(final String profileName) {
        FirefoxProfile profile = getAllProfiles().getProfile(profileName);
        if (profile == null) {
            profile = useExistingFirefoxProfile(new File(profileName));
        }
        return profile;
    }
View Full Code Here

    // Determine the requested browser type
    switch (configuration.getBrowser()) {
      case firefox:
        if (configuration.getProxyConfiguration() != null) {
          FirefoxProfile profile = new FirefoxProfile();

          profile.setPreference("network.proxy.http", configuration
                  .getProxyConfiguration().getHostname());
          profile.setPreference("network.proxy.http_port", configuration
                  .getProxyConfiguration().getPort());
          profile.setPreference("network.proxy.type", configuration
                  .getProxyConfiguration().getType().toInt());
          /* use proxy for everything, including localhost */
          profile.setPreference("network.proxy.no_proxies_on", "");

          return WebDriverBackedEmbeddedBrowser.withDriver(new FirefoxDriver(profile),
                  filterAttributes, crawlWaitReload, crawlWaitEvent);
        }

View Full Code Here

    }
    return null;
  }

  private static WebDriver createFireFoxDriver() {
    FirefoxProfile profile = new FirefoxProfile();
    profile.setPreference( "intl.accept_languages", "no,en-us,en" );
    // to find profile keys, look in <Firefox profile>/prefs.js
    return new FirefoxDriver( profile );
  }
View Full Code Here

        if ("safari".equals(seleniumBrowser)) {
            return new SafariDriver();
        }

        FirefoxProfile profile = new FirefoxProfile();
        profile.setPreference("focusmanager.testmode", true);
        return new FirefoxDriver(profile);
    }
View Full Code Here

   *
   * @throws Exception
   */
  @Before
  public void setUp() throws Exception {
    profile = new FirefoxProfile();
    driver = new FirefoxDriver();
    driver.get("http://localhost:8080/archivator/faces/index.xhtml");
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.firefox.FirefoxProfile

Copyright © 2018 www.massapicom. 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.