Codota Logo
FirefoxOptions.setBinary
Code IndexAdd Codota to your IDE (free)

How to use
setBinary
method
in
org.openqa.selenium.firefox.FirefoxOptions

Best Java code snippets using org.openqa.selenium.firefox.FirefoxOptions.setBinary (Showing top 12 results out of 315)

  • Common ways to obtain FirefoxOptions
private void myMethod () {
FirefoxOptions f =
  • Codota Iconnew FirefoxOptions()
  • Codota IconCapabilities source;new FirefoxOptions(source)
  • Codota IconCapabilities capabilities;new FirefoxOptions().merge(capabilities)
  • Smart code suggestions by Codota
}
origin: selenide/selenide

Capabilities getBrowserBinaryCapabilities(Config config, Browser browser) {
 log.info("Using browser binary: " + config.browserBinary());
 if (browser.isChrome()) {
  ChromeOptions options = new ChromeOptions();
  options.setBinary(config.browserBinary());
  return options;
 } else if (browser.isFirefox()) {
  FirefoxOptions options = new FirefoxOptions();
  options.setBinary(config.browserBinary());
  return options;
 } else {
  log.warning("Changing browser binary on remote server is only supported for Chrome/Firefox, setting will be ignored.");
 }
 return new DesiredCapabilities();
}
origin: selenide/selenide

FirefoxOptions createFirefoxOptions(Config config, Proxy proxy) {
 FirefoxOptions firefoxOptions = new FirefoxOptions();
 firefoxOptions.setHeadless(config.headless());
 if (!config.browserBinary().isEmpty()) {
  log.info("Using browser binary: " + config.browserBinary());
  firefoxOptions.setBinary(config.browserBinary());
 }
 firefoxOptions.addPreference("network.automatic-ntlm-auth.trusted-uris", "http://,https://");
 firefoxOptions.addPreference("network.automatic-ntlm-auth.allow-non-fqdn", true);
 firefoxOptions.addPreference("network.negotiate-auth.delegation-uris", "http://,https://");
 firefoxOptions.addPreference("network.negotiate-auth.trusted-uris", "http://,https://");
 firefoxOptions.addPreference("network.http.phishy-userpass-length", 255);
 firefoxOptions.addPreference("security.csp.enable", false);
 firefoxOptions.addPreference("network.proxy.no_proxies_on", "");
 firefoxOptions.merge(createCommonCapabilities(config, proxy));
 firefoxOptions = transferFirefoxProfileFromSystemProperties(firefoxOptions);
 return firefoxOptions;
}
origin: seleniumQuery/seleniumQuery

/**
 * Sets specific {@link FirefoxBinary} to be used in the {@link FirefoxDriver}.
 *
 * @param firefoxBinary Binary to be used.
 * @return A self reference, allowing further configuration.
 * @since 0.18.0
 */
public FirefoxDriverBuilder withBinary(FirefoxBinary firefoxBinary) {
  getInitializedFirefoxOptions().setBinary(firefoxBinary);
  return this;
}
origin: seleniumQuery/seleniumQuery

/**
 * Sets specific {@link FirefoxBinary} to be used in the {@link FirefoxDriver}.
 *
 * @param firefoxBinary Binary to be used.
 * @return A self reference, allowing further configuration.
 * @since 0.18.0
 */
public FirefoxDriverBuilder withBinary(FirefoxBinary firefoxBinary) {
  getInitializedFirefoxOptions().setBinary(firefoxBinary);
  return this;
}
origin: com.cognifide.qa.bb/bb-core

 @Override
 public WebDriver create(Capabilities capabilities, Properties properties) {
  final File firefoxPath = new File(properties.getProperty(ConfigKeys.WEBDRIVER_FIREFOX_BIN));
  FirefoxBinary firefoxBinary = new FirefoxBinary(firefoxPath);
  firefoxBinary.setEnvironmentProperty("DISPLAY",
    properties.getProperty(ConfigKeys.WEBDRIVER_XVFB_ID));
  FirefoxOptions firefoxOptions = new FirefoxOptions(capabilities).setBinary(firefoxBinary);
  return new FirefoxDriver(firefoxOptions);
 }
};
origin: Cognifide/bobcat

 @Override
 public WebDriver create(Capabilities capabilities, Properties properties) {
  final File firefoxPath = new File(properties.getProperty(ConfigKeys.WEBDRIVER_FIREFOX_BIN));
  FirefoxBinary firefoxBinary = new FirefoxBinary(firefoxPath);
  firefoxBinary.setEnvironmentProperty("DISPLAY",
    properties.getProperty(ConfigKeys.WEBDRIVER_XVFB_ID));
  FirefoxOptions firefoxOptions = new FirefoxOptions(capabilities).setBinary(firefoxBinary);
  return new FirefoxDriver(firefoxOptions);
 }
};
origin: org.seleniumhq.selenium/selenium-firefox-driver

public FirefoxOptions() {
 // Read system properties and use those if they are set, allowing users to override them later
 // should they want to.
 String binary = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_BINARY);
 if (binary != null) {
  setBinary(binary);
 }
 String profileName = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_PROFILE);
 if (profileName != null) {
  FirefoxProfile profile = new ProfilesIni().getProfile(profileName);
  if (profile == null) {
   throw new WebDriverException(String.format(
     "Firefox profile '%s' named in system property '%s' not found",
     profileName, FirefoxDriver.SystemProperty.BROWSER_PROFILE));
  }
  setProfile(profile);
 }
 String forceMarionette = System.getProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE);
 if (forceMarionette != null) {
  setLegacy(!Boolean.getBoolean(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE));
 }
 setCapability(CapabilityType.BROWSER_NAME, BrowserType.FIREFOX);
 setAcceptInsecureCerts(true);
}
origin: com.infotel.seleniumRobot/core

@Override
protected void updateOptionsWithSelectedBrowserInfo(MutableCapabilities options) {
  if (BrowserInfo.useLegacyFirefoxVersion(selectedBrowserInfo.getVersion())) {
    options.setCapability(FirefoxDriver.MARIONETTE, false);
  } else {
    options.setCapability(FirefoxDriver.MARIONETTE, true);
  }
  
  ((FirefoxOptions)options).setBinary(selectedBrowserInfo.getPath());
}
 
origin: org.seleniumhq.selenium/selenium-firefox-driver

if (that.containsKey("binary")) { setBinary((String) that.get("binary")); }
if (that.containsKey("log")) {
 Map<?, ?> logStruct = (Map<?, ?>) that.get("log");
origin: com.vaadin/vaadin-testbench-core

options.setBinary(new FirefoxBinary(new File(firefoxPath)));
origin: bonigarcia/selenium-jupiter

firefoxOptions.setBinary(binary.value());
origin: vmi/selenese-runner-java

@Override
public WebDriver newInstance(DriverOptions driverOptions) {
  GeckoDriverService service = setupBuilder(new GeckoDriverService.Builder(), driverOptions, GECKODRIVER).build();
  FirefoxOptions firefoxOptions = newFirefoxOptions(driverOptions);
  String firefoxBin = getFirefoxBinary(driverOptions);
  if (firefoxBin != null)
    firefoxOptions.setBinary(firefoxBin);
  if (driverOptions.has(CLI_ARGS))
    firefoxOptions.addArguments(driverOptions.getCliArgs());
  FirefoxProfile profile = getFirefoxProfile(driverOptions);
  if (profile != null)
    firefoxOptions.setProfile(profile);
  firefoxOptions.merge(driverOptions.getCapabilities());
  FirefoxDriver driver = new FirefoxDriver(service, firefoxOptions);
  setInitialWindowSize(driver, driverOptions);
  return driver;
}
org.openqa.selenium.firefoxFirefoxOptionssetBinary

Popular methods of FirefoxOptions

  • <init>
  • setProfile
  • setHeadless
  • merge
  • addArguments
  • addPreference
  • setCapability
  • setLogLevel
  • setAcceptInsecureCerts
  • getProfile
  • setLegacy
  • setProxy
  • setLegacy,
  • setProxy,
  • SetLoggingPreference,
  • getBinary,
  • getBinaryOrNull,
  • getBrowserName,
  • isLegacy,
  • setUnhandledPromptBehaviour,
  • toString

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • findViewById (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • BoxLayout (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now