### Home Classes Methods

### In Files

- common/src/rb/lib/selenium/webdriver/options.rb

### Parent

Object

### Methods

- ::new
- #add_cookie
- #all_cookies
- #delete_all_cookies
- #delete_cookie
- #speed
- #speed=
- #timeouts

### Class/Module Index

Quicksearch

- Selenium
- Selenium::WebDriver
- Selenium::WebDriver::BridgeHelper
- Selenium::WebDriver::ChildProcess
- Selenium::WebDriver::ChildProcess::IronRubyProcess
- Selenium::WebDriver::ChildProcess::JRubyProcess
- Selenium::WebDriver::ChildProcess::WindowsProcess
- Selenium::WebDriver::Chrome
- Selenium::WebDriver::Chrome::Bridge
- Selenium::WebDriver::Chrome::CommandExecutor
- Selenium::WebDriver::Chrome::Launcher
- Selenium::WebDriver::Chrome::Launcher::MacOSXLauncher
- Selenium::WebDriver::Chrome::Launcher::UnixLauncher
- Selenium::WebDriver::Chrome::Launcher::WindowsLauncher
- Selenium::WebDriver::Driver
- Selenium::WebDriver::DriverExtensions
- Selenium::WebDriver::DriverExtensions::TakesScreenshot
- Selenium::WebDriver::Element
- Selenium::WebDriver::Error
- Selenium::WebDriver::Error::ElementNotDisplayedError
- Selenium::WebDriver::Error::ElementNotEnabledError
- Selenium::WebDriver::Error::ElementNotSelectableError
- Selenium::WebDriver::Error::ExpectedError
- Selenium::WebDriver::Error::IndexOutOfBoundsError
- Selenium::WebDriver::Error::InvalidCookieDomainError
- 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::ServerError
- Selenium::WebDriver::Error::TimeOutError
- Selenium::WebDriver::Error::UnableToSetCookieError
- Selenium::WebDriver::Error::UnexpectedJavascriptError
- Selenium::WebDriver::Error::UnhandledError
- Selenium::WebDriver::Error::UnknownCommandError
- Selenium::WebDriver::Error::UnknownScriptResultError
- Selenium::WebDriver::Error::UnsupportedOperationError
- Selenium::WebDriver::Error::WebDriverError
- Selenium::WebDriver::FileReaper
- Selenium::WebDriver::Find
- Selenium::WebDriver::Firefox
- Selenium::WebDriver::Firefox::Binary
- Selenium::WebDriver::Firefox::Bridge
- Selenium::WebDriver::Firefox::Launcher
- Selenium::WebDriver::Firefox::Profile
- Selenium::WebDriver::Firefox::ProfilesIni
- Selenium::WebDriver::Firefox::Util
- Selenium::WebDriver::IE
- Selenium::WebDriver::IE::Bridge
- Selenium::WebDriver::IE::Kernel32
- Selenium::WebDriver::IE::Lib
- Selenium::WebDriver::IE::Util
- Selenium::WebDriver::Keys
- Selenium::WebDriver::Navigation
- Selenium::WebDriver::Options
- Selenium::WebDriver::Platform
- 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::Response
- Selenium::WebDriver::TargetLocator
- Selenium::WebDriver::Timeouts
- Dir
- SocketError
- String

No matching classes.

# Selenium::WebDriver::Options

### Public Class Methods

new(driver) click to toggle source

@private

    # File common/src/rb/lib/selenium/webdriver/options.rb, line 9
    def initialize(driver)
      @bridge = driver.bridge
    end

### Public Instance Methods

add_cookie(opts = {}) click to toggle source

Add a cookie to the browser

@param [Hash] opts the options to create a cookie with. @option opts [String] :name A name @option opts [String] :value A value @option opts [String] :path (‘/’) A path @option opts [String] :secure (false) A boolean

@raise [ArgumentError] if :name or :value is not specified

    # File common/src/rb/lib/selenium/webdriver/options.rb, line 25
    def add_cookie(opts = {})
      raise ArgumentError, "name is required" unless opts[:name]
      raise ArgumentError, "value is required" unless opts[:value]

      opts[:path] ||= "/"
      opts[:secure] ||= false

      @bridge.addCookie opts
    end

all_cookies() click to toggle source

Get all cookies

@return [Array<Hash>] list of cookies

    # File common/src/rb/lib/selenium/webdriver/options.rb, line 59
    def all_cookies
      @bridge.getAllCookies.map do |cookie|
        {
          :name    => cookie["name"],
          :value   => cookie["value"],
          :path    => cookie["path"],
          :domain  => cookie["domain"],
          :expires => cookie["expires"],
          :secure  => cookie["secure"]
        }
      end
    end

delete_all_cookies() click to toggle source

Delete all cookies

    # File common/src/rb/lib/selenium/webdriver/options.rb, line 49
    def delete_all_cookies
      @bridge.deleteAllCookies
    end

delete_cookie(name) click to toggle source

Delete the cookie with the given name

@param [String] name the name of the cookie to delete

    # File common/src/rb/lib/selenium/webdriver/options.rb, line 41
    def delete_cookie(name)
      @bridge.deleteCookie name
    end

speed() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/options.rb, line 72
    def speed
      @bridge.getSpeed.downcase.to_sym
    end

speed=(speed) click to toggle source

    # File common/src/rb/lib/selenium/webdriver/options.rb, line 76
    def speed=(speed)
      @bridge.setSpeed(speed.to_s.upcase)
    end

timeouts() click to toggle source

    # File common/src/rb/lib/selenium/webdriver/options.rb, line 80
    def timeouts
      @timeouts ||= Timeouts.new(@bridge)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.