Tabnine Logo
Proxy.setFtpProxy
Code IndexAdd Tabnine to your IDE (free)

How to use
setFtpProxy
method
in
org.openqa.selenium.Proxy

Best Java code snippets using org.openqa.selenium.Proxy.setFtpProxy (Showing top 20 results out of 315)

origin: org.jspringbot/jspringbot-selenium

public void setFtpProxy(String proxyHost) {
  if (!StringUtils.equalsIgnoreCase(proxyHost, "none")) {
    proxy = new Proxy();
    proxy.setFtpProxy(proxyHost);
    capabilities.setCapability(CapabilityType.PROXY, proxy);
  }
}
origin: qaprosoft/carina

protected Proxy setupProxy() {
  ProxyPool.setupBrowserMobProxy();
  SystemProxy.setupProxy();
  
  String proxyHost = Configuration.get(Parameter.PROXY_HOST);
  String proxyPort = Configuration.get(Parameter.PROXY_PORT);
  List<String> protocols = Arrays.asList(Configuration.get(Parameter.PROXY_PROTOCOLS).split("[\\s,]+"));
  if (proxyHost != null && !proxyHost.isEmpty() && proxyPort != null && !proxyPort.isEmpty()) {
    org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
    String proxyAddress = String.format("%s:%s", proxyHost, proxyPort);
    if (protocols.contains("http")) {
      LOGGER.info(String.format("Http proxy will be set: %s:%s", proxyHost, proxyPort));
      proxy.setHttpProxy(proxyAddress);
    }
    if (protocols.contains("https")) {
      LOGGER.info(String.format("Https proxy will be set: %s:%s", proxyHost, proxyPort));
      proxy.setSslProxy(proxyAddress);
    }
    if (protocols.contains("ftp")) {
      LOGGER.info(String.format("FTP proxy will be set: %s:%s", proxyHost, proxyPort));
      proxy.setFtpProxy(proxyAddress);
    }
    if (protocols.contains("socks")) {
      LOGGER.info(String.format("Socks proxy will be set: %s:%s", proxyHost, proxyPort));
      proxy.setSocksProxy(proxyAddress);
    }
    return proxy;
  }
  return null;
}
origin: org.jspringbot/jspringbot-selenium

public void setProxy(String proxyHost) {
  if (!StringUtils.equalsIgnoreCase(proxyHost, "none")) {
    proxy = new Proxy();
    proxy.setFtpProxy(proxyHost)
        .setHttpProxy(proxyHost)
        .setSslProxy(proxyHost);
    capabilities.setCapability(CapabilityType.PROXY, proxy);
  }
}
origin: org.seleniumhq.selenium/selenium-api

setFtpProxy((String) raw.get("ftpProxy"));
origin: paypal/SeLion

/**
 * @return - A {@link Proxy} object that represents the Proxy server to be used.
 */
public static Proxy createProxyObject() {
  Proxy proxy = new Proxy();
  String proxyHost = String.format("%s:%s", getProperty(ConfigProperty.SELENIUM_PROXY_HOST),
      getProperty(ConfigProperty.SELENIUM_PROXY_PORT));
  proxy.setHttpProxy(proxyHost);
  proxy.setFtpProxy(proxyHost);
  proxy.setSslProxy(proxyHost);
  return proxy;
}
origin: com.technophobia.substeps/webdriver-substeps

private void setNetworkCapabilities(final DesiredCapabilities capabilities) {
  final String proxyHost = configuration.getNetworkProxyHost();
  if (StringUtils.isNotEmpty(proxyHost)) {
    final int proxyPort = configuration.getNetworkProxyPort();
    final String proxyHostAndPort = proxyHost + ":" + proxyPort;
    final org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
    proxy.setHttpProxy(proxyHostAndPort).setFtpProxy(proxyHostAndPort).setSslProxy(proxyHostAndPort);
    capabilities.setCapability(CapabilityType.PROXY, proxy);
    LOG.info("Proxy set to {}", proxyHostAndPort);
  }
}
origin: Frameworkium/frameworkium-core

private static Proxy createManualProxy(String proxyProperty) {
  String proxyString = getProxyURL(proxyProperty);
  logger.debug("All protocols to use proxy address: {}", proxyString);
  Proxy proxy = new Proxy();
  proxy.setProxyType(Proxy.ProxyType.MANUAL)
      .setHttpProxy(proxyString)
      .setFtpProxy(proxyString)
      .setSslProxy(proxyString);
  return proxy;
}
origin: tarun3kumar/seleniumtestsframework

public Proxy getProxy() {
  Proxy proxy = null;
  if (proxyHost != null) {
    proxy = new Proxy();
    proxy.setProxyType(ProxyType.MANUAL);
    proxy.setHttpProxy(proxyHost);
    proxy.setFtpProxy(proxyHost);
    proxy.setSslProxy(proxyHost);
  }
  return proxy;
}
origin: org.paxml/PaxmlSelenium

proxy.setFtpProxy(proxyFtp);
origin: org.paxml/paxml-selenium

proxy.setFtpProxy(proxyFtp);
origin: org.finra.jtaf/jtaf-extwebdriver

if (proxyProperty != null) {
  Proxy proxy = new Proxy();
  proxy.setHttpProxy(proxyProperty).setFtpProxy(proxyProperty).setSslProxy(
      proxyProperty);
  desiredCapabilities = new DesiredCapabilities();
origin: FINRAOS/JTAF-ExtWebDriver

if (proxyProperty != null) {
  Proxy proxy = new Proxy();
  proxy.setHttpProxy(proxyProperty).setFtpProxy(proxyProperty).setSslProxy(
      proxyProperty);
  desiredCapabilities = new DesiredCapabilities();
origin: org.unitils.selenium/unitils-selenium

/**
 * Creates the DesiredCapabilities for an IE WebDriver.
 * @param proxyUrl
 * @return DesiredCapabilities
 */
protected static DesiredCapabilities createCapabilitiesIE(String proxyUrl) {
  DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
  cap.setCapability(CapabilityType.LOGGING_PREFS, createLoggingPreferences());
  cap.setCapability("ignoreProtectedModeSettings", true);
  cap.setCapability("ignoreZoomSetting", true);
  if (StringUtils.isNotEmpty(proxyUrl)) {
    Proxy proxy = new Proxy();
    proxy.setHttpProxy(proxyUrl).setFtpProxy(proxyUrl).setSslProxy(proxyUrl).setNoProxy("");
    cap.setCapability(CapabilityType.PROXY, proxy);
  }
  return cap;
}
origin: org.unitils.selenium/unitils-selenium

/**
 * Creates the DesiredCapabilities for firefox.
 * @param proxyUrl
 * @param profile
 * @return DesiredCapabilities
 */
protected static DesiredCapabilities createCapabilitesFirefox(String proxyUrl, FirefoxProfile profile) {
  DesiredCapabilities capabilities = DesiredCapabilities.firefox();
  if (!proxyUrl.isEmpty()) {
    capabilities.setCapability(FirefoxDriver.PROFILE, profile);
    profile.setPreference("network.proxy.type", 1);
    Proxy proxy = new Proxy();
    proxy.setHttpProxy(proxyUrl).setFtpProxy(proxyUrl).setSslProxy(proxyUrl).setNoProxy("");
    capabilities.setCapability(CapabilityType.PROXY, proxy);
  }
  capabilities.setCapability(CapabilityType.LOGGING_PREFS, createLoggingPreferences());
  return capabilities;
}
origin: gradle.plugin.GoBqa/gradle-plugin

proxy.setHttpProxy(PROXY).setFtpProxy(PROXY).setSslProxy(PROXY).setSocksProxy(PROXY);
cap.setCapability(CapabilityType.PROXY, proxy);
origin: vmi/selenese-runner-java

/**
 * Create new Proxy from driver options.
 *
 * @param driverOptions driver options.
 * @return Proxy or null.
 */
public static Proxy newProxy(DriverOptions driverOptions) {
  if (!driverOptions.has(PROXY))
    return null;
  Proxy proxy = new Proxy();
  proxy.setProxyType(ProxyType.MANUAL);
  String ps = driverOptions.get(PROXY);
  proxy.setHttpProxy(ps)
    .setSslProxy(ps)
    .setFtpProxy(ps);
  if (driverOptions.has(NO_PROXY))
    proxy.setNoProxy(driverOptions.get(NO_PROXY));
  return proxy;
}
origin: kg.apc/jmeter-plugins-webdriver

/**
 * This returns a {@link Proxy} with HTTP, HTTPS and FTP hosts and ports configured as specified.
 *
 *
 * @param httpProxy is the http proxy host and port
 * @param httpsProxy is the https proxy host and port
 * @param ftpProxy is the ftp proxy host and port
 * @param socksProxy is the socks proxy host and port
 * @param noProxy is a comma separated list of hosts that will bypass the proxy
 *
 * @return a proxy object with the hosts manually specified.
 */
public Proxy getManualProxy(ProxyHostPort httpProxy, ProxyHostPort httpsProxy, ProxyHostPort ftpProxy, ProxyHostPort socksProxy, String noProxy) {
  return new Proxy()
    .setProxyType(Proxy.ProxyType.MANUAL)
    .setHttpProxy(httpProxy.toUnifiedForm())
    .setSslProxy(httpsProxy.toUnifiedForm())
    .setFtpProxy(ftpProxy.toUnifiedForm())
    .setSocksProxy(socksProxy.toUnifiedForm())
    .setNoProxy(noProxy);
}
origin: org.bitbucket.iamkenos/cissnei-selenium

proxy.setFtpProxy(wdProxy).setHttpProxy(wdProxy).setSslProxy(wdProxy);
options.setCapability(PROXY, proxy);
origin: org.bitbucket.iamkenos/cissnei-selenium

proxy.setFtpProxy(wdProxy).setHttpProxy(wdProxy).setSslProxy(wdProxy);
options.setCapability(PROXY, proxy);
origin: com.infotel.seleniumRobot/core

public Proxy getProxy() {
  ProxyConfig proxyConfig = getProxyConfig();
  
  Proxy proxy = new Proxy();
  proxy.setProxyType(proxyConfig.getType());
  
  if (proxyConfig.getType() == ProxyType.PAC) {
    proxy.setProxyAutoconfigUrl(proxyConfig.getPac());
    
  // manual proxy configuration
  } else if (proxyConfig.getType() == ProxyType.MANUAL) {
    proxy.setHttpProxy(proxyConfig.getAddressAndPort());
    proxy.setSslProxy(proxyConfig.getAddressAndPort());
    proxy.setFtpProxy(proxyConfig.getAddressAndPort());
    
    if (proxyConfig.getLogin() != null && proxyConfig.getPassword() != null) {
      proxy.setSocksUsername(proxyConfig.getLogin());
      proxy.setSocksPassword(proxyConfig.getPassword());
    }
    
    if (proxyConfig.getExclude() != null) {
      proxy.setNoProxy(proxyConfig.getExclude().replace(";", ","));
    }
  }     
  
  return proxy;
}
org.openqa.seleniumProxysetFtpProxy

Javadoc

Specify which proxy to use for FTP connections.

Popular methods of Proxy

  • <init>
  • setHttpProxy
    Specify which proxy to use for HTTP connections.
  • setSslProxy
    Specify which proxy to use for SSL connections.
  • setProxyType
    Explicitly sets the proxy type, useful for forcing direct connection on Linux.
  • extractFrom
  • getHttpProxy
    Gets the HTTP proxy.
  • setNoProxy
    Sets proxy bypass (noproxy) addresses
  • getProxyType
    Gets the ProxyType. This can signal if set to use a direct connection (without proxy), manually set
  • setProxyAutoconfigUrl
    Specifies the URL to be used for proxy auto-configuration. Expected format is http://hostname.com:12
  • setSocksProxy
    Specifies which proxy to use for SOCKS.
  • getSocksProxy
    Gets the SOCKS proxy.
  • setAutodetect
    Specifies whether to autodetect proxy settings.
  • getSocksProxy,
  • setAutodetect,
  • getProxyAutoconfigUrl,
  • getSocksPassword,
  • getSocksUsername,
  • getFtpProxy,
  • getNoProxy,
  • setSocksPassword,
  • setSocksUsername

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • JComboBox (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now