### Home Classes Methods

### In Files

- lib/selenium/webdriver/common/proxy.rb

### Parent

Object

### Methods

- ::json_create
- ::new
- #==
- #as_json
- #auto_detect=
- #eql?
- #ftp=
- #http=
- #no_proxy=
- #pac=
- #ssl=
- #to_json
- #type=

### Class/Module Index

Quicksearch

- Selenium
- Selenium::Client
- Selenium::Client::Base
- Selenium::Client::CommandError
- Selenium::Client::Driver
- Selenium::Client::Extensions
- Selenium::Client::GeneratedDriver
- Selenium::Client::Idiomatic
- Selenium::Client::JavascriptExpressionBuilder
- Selenium::Client::JavascriptFrameworks
- Selenium::Client::JavascriptFrameworks::JQuery
- Selenium::Client::JavascriptFrameworks::Prototype
- Selenium::Client::Protocol
- Selenium::Client::ProtocolError
- Selenium::Client::SeleniumHelper
- Selenium::Rake
- Selenium::Rake::MissingJarFileError
- Selenium::Rake::ServerTask
- Selenium::Server
- Selenium::Server::Error
- Selenium::WebDriver
- Selenium::WebDriver::ActionBuilder
- Selenium::WebDriver::Alert
- Selenium::WebDriver::Android
- Selenium::WebDriver::Android::Bridge
- Selenium::WebDriver::BridgeHelper
- Selenium::WebDriver::Chrome
- Selenium::WebDriver::Chrome::Bridge
- Selenium::WebDriver::Chrome::Profile
- Selenium::WebDriver::Chrome::Service
- Selenium::WebDriver::Driver
- Selenium::WebDriver::DriverExtensions
- Selenium::WebDriver::DriverExtensions::HasBrowserConnection
- Selenium::WebDriver::DriverExtensions::HasInputDevices
- Selenium::WebDriver::DriverExtensions::HasLocation
- Selenium::WebDriver::DriverExtensions::HasSessionId
- Selenium::WebDriver::DriverExtensions::HasTouchScreen
- Selenium::WebDriver::DriverExtensions::HasWebStorage
- Selenium::WebDriver::DriverExtensions::Rotatable
- Selenium::WebDriver::DriverExtensions::TakesScreenshot
- Selenium::WebDriver::DriverExtensions::UploadsFiles
- Selenium::WebDriver::Element
- Selenium::WebDriver::Error
- Selenium::WebDriver::Error::ElementNotDisplayedError
- Selenium::WebDriver::Error::ElementNotSelectableError
- Selenium::WebDriver::Error::ElementNotVisibleError
- Selenium::WebDriver::Error::ExpectedError
- Selenium::WebDriver::Error::IMEEngineActivationFailedError
- Selenium::WebDriver::Error::IMENotAvailableError
- Selenium::WebDriver::Error::IndexOutOfBoundsError
- Selenium::WebDriver::Error::InvalidCookieDomainError
- Selenium::WebDriver::Error::InvalidElementCoordinatesError
- Selenium::WebDriver::Error::InvalidElementStateError
- Selenium::WebDriver::Error::InvalidSelectorError
- Selenium::WebDriver::Error::JavascriptError
- Selenium::WebDriver::Error::MoveTargetOutOfBoundsError
- Selenium::WebDriver::Error::NoAlertOpenError
- Selenium::WebDriver::Error::NoAlertPresentError
- Selenium::WebDriver::Error::NoCollectionError
- Selenium::WebDriver::Error::NoScriptResultError
- Selenium::WebDriver::Error::NoStringError
- Selenium::WebDriver::Error::NoStringLengthError
- Selenium::WebDriver::Error::NoStringWrapperError
- Selenium::WebDriver::Error::NoSuchCollectionError
- Selenium::WebDriver::Error::NoSuchDocumentError
- Selenium::WebDriver::Error::NoSuchDriverError
- Selenium::WebDriver::Error::NoSuchElementError
- Selenium::WebDriver::Error::NoSuchFrameError
- Selenium::WebDriver::Error::NoSuchWindowError
- Selenium::WebDriver::Error::NullPointerError
- Selenium::WebDriver::Error::ObsoleteElementError
- Selenium::WebDriver::Error::ScriptTimeOutError
- Selenium::WebDriver::Error::ServerError
- Selenium::WebDriver::Error::StaleElementReferenceError
- Selenium::WebDriver::Error::TimeOutError
- Selenium::WebDriver::Error::UnableToSetCookieError
- Selenium::WebDriver::Error::UnexpectedJavascriptError
- Selenium::WebDriver::Error::UnhandledAlertError
- Selenium::WebDriver::Error::UnhandledError
- Selenium::WebDriver::Error::UnknownCommandError
- Selenium::WebDriver::Error::UnknownError
- Selenium::WebDriver::Error::UnsupportedOperationError
- Selenium::WebDriver::Error::WebDriverError
- Selenium::WebDriver::Error::XPathLookupError
- Selenium::WebDriver::FileReaper
- Selenium::WebDriver::Firefox
- Selenium::WebDriver::Firefox::Binary
- Selenium::WebDriver::Firefox::Bridge
- Selenium::WebDriver::Firefox::Extension
- Selenium::WebDriver::Firefox::Launcher
- Selenium::WebDriver::Firefox::Profile
- Selenium::WebDriver::Firefox::ProfilesIni
- Selenium::WebDriver::Firefox::SocketLock
- Selenium::WebDriver::Firefox::Util
- Selenium::WebDriver::HTML5
- Selenium::WebDriver::HTML5::LocalStorage
- Selenium::WebDriver::HTML5::SessionStorage
- Selenium::WebDriver::HTML5::SharedWebStorage
- Selenium::WebDriver::IE
- Selenium::WebDriver::IE::Bridge
- Selenium::WebDriver::IE::Server
- Selenium::WebDriver::IPhone
- Selenium::WebDriver::IPhone::Bridge
- Selenium::WebDriver::JsonHelper
- Selenium::WebDriver::Keyboard
- Selenium::WebDriver::Keys
- Selenium::WebDriver::LogEntry
- Selenium::WebDriver::Mouse
- Selenium::WebDriver::Navigation
- Selenium::WebDriver::Opera
- Selenium::WebDriver::Opera::Bridge
- Selenium::WebDriver::Opera::Service
- Selenium::WebDriver::Options
- Selenium::WebDriver::PhantomJS
- Selenium::WebDriver::PhantomJS::Bridge
- Selenium::WebDriver::PhantomJS::Service
- Selenium::WebDriver::Platform
- Selenium::WebDriver::PortProber
- Selenium::WebDriver::ProfileHelper
- Selenium::WebDriver::ProfileHelper::ClassMethods
- Selenium::WebDriver::Proxy
- Selenium::WebDriver::Remote
- Selenium::WebDriver::Remote::Bridge
- Selenium::WebDriver::Remote::Capabilities
- Selenium::WebDriver::Remote::Http
- Selenium::WebDriver::Remote::Http::Common
- Selenium::WebDriver::Remote::Http::Curb
- Selenium::WebDriver::Remote::Http::Default
- Selenium::WebDriver::Remote::Http::Persistent
- Selenium::WebDriver::Remote::Response
- Selenium::WebDriver::Safari
- Selenium::WebDriver::Safari::Bridge
- Selenium::WebDriver::Safari::Browser
- Selenium::WebDriver::Safari::Extension
- Selenium::WebDriver::Safari::Server
- Selenium::WebDriver::SearchContext
- Selenium::WebDriver::SocketPoller
- Selenium::WebDriver::Support
- Selenium::WebDriver::Support::AbstractEventListener
- Selenium::WebDriver::Support::BlockEventListener
- Selenium::WebDriver::Support::Color
- Selenium::WebDriver::Support::EventFiringBridge
- Selenium::WebDriver::Support::Select
- Selenium::WebDriver::Support::Select::Escaper
- Selenium::WebDriver::TargetLocator
- Selenium::WebDriver::Timeouts
- Selenium::WebDriver::TouchActionBuilder
- Selenium::WebDriver::TouchScreen
- Selenium::WebDriver::Wait
- Selenium::WebDriver::Window
- Selenium::WebDriver::Zipper
- Base64
- Dir
- SocketError
- String

No matching classes.

# Selenium::WebDriver::Proxy

### Constants

TYPES

### Attributes

auto_detect[R]
ftp[R]
http[R]
no_proxy[R]
pac[R]
ssl[R]
type[R]

### Public Class Methods

json_create(data) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 103
    def json_create(data)
      return if data['proxyType'] == 'UNSPECIFIED'

      proxy = new

      proxy.type        = data['proxyType'].downcase.to_sym if data.has_key? 'proxyType'
      proxy.ftp         = data['ftpProxy'] if data.has_key? 'ftpProxy'
      proxy.http        = data['httpProxy'] if data.has_key? 'httpProxy'
      proxy.no_proxy    = data['noProxy'] if data.has_key? 'noProxy'
      proxy.pac         = data['proxyAutoconfigUrl'] if data.has_key? 'proxyAutoconfigUrl'
      proxy.ssl         = data['sslProxy'] if data.has_key? 'sslProxy'
      proxy.auto_detect = data['autodetect'] if data.has_key? 'autodetect'

      proxy
    end

new(opts = {}) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 20
    def initialize(opts = {})
      opts = opts.dup

      self.type        = opts.delete(:type) if opts.has_key? :type
      self.ftp         = opts.delete(:ftp) if opts.has_key? :ftp
      self.http        = opts.delete(:http) if opts.has_key? :http
      self.no_proxy    = opts.delete(:no_proxy) if opts.has_key? :no_proxy
      self.ssl         = opts.delete(:ssl) if opts.has_key? :ssl
      self.pac         = opts.delete(:pac) if opts.has_key? :pac
      self.auto_detect = opts.delete(:auto_detect) if opts.has_key? :auto_detect

      unless opts.empty?
        raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}"
      end
    end

### Public Instance Methods

==(other) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 36
    def ==(other)
      other.kind_of?(self.class) && as_json == other.as_json
    end

Also aliased as: eql?
as_json(opts = nil) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 83
    def as_json(opts = nil)
      json_result = {
        "proxyType" => TYPES[type]
      }

      json_result["ftpProxy"]           = ftp if ftp
      json_result["httpProxy"]          = http if http
      json_result["noProxy"]            = no_proxy if no_proxy
      json_result["proxyAutoconfigUrl"] = pac if pac
      json_result["sslProxy"]           = ssl if ssl
      json_result["autodetect"]         = auto_detect if auto_detect

      json_result if json_result.length > 1
    end

auto_detect=(bool) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 66
    def auto_detect=(bool)
      self.type = :auto_detect
      @auto_detect = bool
    end

eql?(other) click to toggle source
Alias for: ==
ftp=(value) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 41
    def ftp=(value)
      self.type = :manual
      @ftp = value
    end

http=(value) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 46
    def http=(value)
      self.type = :manual
      @http = value
    end

no_proxy=(value) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 51
    def no_proxy=(value)
      self.type = :manual
      @no_proxy = value
    end

pac=(url) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 61
    def pac=(url)
      self.type = :pac
      @pac = url
    end

ssl=(value) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 56
    def ssl=(value)
      self.type = :manual
      @ssl = value
    end

to_json(*args) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 98
    def to_json(*args)
      WebDriver.json_dump as_json
    end

type=(type) click to toggle source

    # File lib/selenium/webdriver/common/proxy.rb, line 71
    def type=(type)
      unless TYPES.has_key? type
        raise ArgumentError, "invalid proxy type: #{type.inspect}, expected one of #{TYPES.keys.inspect}"
      end

      if defined?(@type) && type != @type
        raise ArgumentError, "incompatible proxy type #{type.inspect} (already set to #{@type.inspect})"
      end

      @type = type
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.