### Home Classes Methods

### In Files

- remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb

### Parent

Object

### Methods

- ::chrome
- ::firefox
- ::htmlunit
- ::internet_explorer
- ::iphone
- ::json_create
- ::new
- ::safari
- #to_json

### 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::Remote::Capabilities

Specification of the desired and/or actual capabilities of the browser that the server is being asked to create.

### Attributes

browser_name[RW]
javascript?[RW]
javascript_enabled[RW]
platform[RW]
version[RW]

### Public Class Methods

chrome(opts = {}) click to toggle source

    # File remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb, line 53
    def chrome(opts = {})
      new({
        :browser_name       => "chrome",
        :javascript_enabled => true
      }.merge(opts))
    end

firefox(opts = {}) click to toggle source

    # File remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb, line 19
    def firefox(opts = {})
      new({
        :browser_name => "firefox",
        :javascript_enabled => true
      }.merge(opts))
    end

htmlunit(opts = {}) click to toggle source

    # File remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb, line 33
    def htmlunit(opts = {})
      new({
        :browser_name => "htmlunit"
      }.merge(opts))
    end

internet_explorer(opts = {}) click to toggle source

    # File remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb, line 26
    def internet_explorer(opts = {})
      new({
        :browser_name => "internet explorer",
        :platform     => :windows
      }.merge(opts))
    end

iphone(opts = {}) click to toggle source

    # File remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb, line 46
    def iphone(opts = {})
      new({
        :browser_name => "iphone",
        :platform     => :mac
      }.merge(opts))
    end

json_create(data) click to toggle source

@api private

    # File remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb, line 64
    def json_create(data)
      new(
        :browser_name       => data["browserName"],
        :version            => data["version"],
        :platform           => data["platform"].downcase.to_sym,
        :javascript_enabled => data["javascriptEnabled"]
      )
    end

new(opts = {}) click to toggle source

@option :browser_name [String] required browser name @option :version [String] required browser version number @option :platform [Symbol] one of :any, :win, :mac, or :x @option :javascript_enabled [Boolean] should the test run with javascript enabled?

@api public

    # File remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb, line 82
    def initialize(opts = {})
      @browser_name       = opts[:browser_name]       || ""
      @version            = opts[:version]            || ""
      @platform           = opts[:platform]           || :any
      @javascript_enabled = opts[:javascript_enabled] || false
    end

safari(opts = {}) click to toggle source

    # File remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb, line 39
    def safari(opts = {})
      new({
        :browser_name => "safari",
        :platform     => :mac
      }.merge(opts))
    end

### Public Instance Methods

to_json(*args) click to toggle source

@api private

    # File remote/client/src/rb/lib/selenium/webdriver/remote/capabilities.rb, line 93
    def to_json(*args)
      {
        "browserName"       => browser_name,
        "version"           => version,
        "platform"          => platform.to_s.upcase,
        "javascriptEnabled" => javascript?
      }.to_json(*args)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.