org.openqa.selenium.remote
Class DesiredCapabilities

java.lang.Object
  extended by org.openqa.selenium.remote.DesiredCapabilities
All Implemented Interfaces:
Serializable, Capabilities

public class DesiredCapabilities
extends Object
implements Serializable, Capabilities

See Also:
Serialized Form

Constructor Summary
DesiredCapabilities()
           
DesiredCapabilities(Capabilities... others)
           
DesiredCapabilities(Capabilities other)
           
DesiredCapabilities(Map<String,?> rawMap)
           
DesiredCapabilities(String browser, String version, Platform platform)
           
 
Method Summary
static DesiredCapabilities android()
           
 Map<String,?> asMap()
           
static DesiredCapabilities chrome()
           
 boolean equals(Object o)
           
static DesiredCapabilities firefox()
           
 String getBrowserName()
           
 Object getCapability(String capabilityName)
           
 Platform getPlatform()
           
 String getVersion()
           
 int hashCode()
           
static DesiredCapabilities htmlUnit()
           
static DesiredCapabilities internetExplorer()
           
static DesiredCapabilities ipad()
           
static DesiredCapabilities iphone()
           
 boolean is(String capabilityName)
           
 boolean isJavascriptEnabled()
           
 DesiredCapabilities merge(Capabilities extraCapabilities)
          Merges the extra capabilities provided into this DesiredCapabilities instance.
static DesiredCapabilities opera()
           
static DesiredCapabilities phantomjs()
           
static DesiredCapabilities safari()
           
 void setBrowserName(String browserName)
           
 void setCapability(String capabilityName, boolean value)
           
 void setCapability(String key, Object value)
           
 void setCapability(String capabilityName, Platform value)
           
 void setCapability(String capabilityName, String value)
           
 void setJavascriptEnabled(boolean javascriptEnabled)
           
 void setPlatform(Platform platform)
           
 void setVersion(String version)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DesiredCapabilities

public DesiredCapabilities(String browser,
                           String version,
                           Platform platform)

DesiredCapabilities

public DesiredCapabilities()

DesiredCapabilities

public DesiredCapabilities(Map<String,?> rawMap)

DesiredCapabilities

public DesiredCapabilities(Capabilities other)

DesiredCapabilities

public DesiredCapabilities(Capabilities... others)
Method Detail

getBrowserName

public String getBrowserName()
Specified by:
getBrowserName in interface Capabilities

setBrowserName

public void setBrowserName(String browserName)

getVersion

public String getVersion()
Specified by:
getVersion in interface Capabilities

setVersion

public void setVersion(String version)

getPlatform

public Platform getPlatform()
Specified by:
getPlatform in interface Capabilities

setPlatform

public void setPlatform(Platform platform)

isJavascriptEnabled

public boolean isJavascriptEnabled()
Specified by:
isJavascriptEnabled in interface Capabilities

setJavascriptEnabled

public void setJavascriptEnabled(boolean javascriptEnabled)

getCapability

public Object getCapability(String capabilityName)
Specified by:
getCapability in interface Capabilities
Parameters:
capabilityName - The capability to return.
Returns:
The value, or null if not set.
See Also:
CapabilityType

is

public boolean is(String capabilityName)
Specified by:
is in interface Capabilities
Parameters:
capabilityName - The capability to check.
Returns:
Whether or not the value is not null and not false.
See Also:
CapabilityType

merge

public DesiredCapabilities merge(Capabilities extraCapabilities)
Merges the extra capabilities provided into this DesiredCapabilities instance. If capabilities with the same name exist in this instance, they will be overridden by the values from the extraCapabilities object.

Parameters:
extraCapabilities - Additional capabilities to be added.

setCapability

public void setCapability(String capabilityName,
                          boolean value)

setCapability

public void setCapability(String capabilityName,
                          String value)

setCapability

public void setCapability(String capabilityName,
                          Platform value)

setCapability

public void setCapability(String key,
                          Object value)

asMap

public Map<String,?> asMap()
Specified by:
asMap in interface Capabilities
Returns:
The capabilities as a Map

android

public static DesiredCapabilities android()

chrome

public static DesiredCapabilities chrome()

firefox

public static DesiredCapabilities firefox()

htmlUnit

public static DesiredCapabilities htmlUnit()

internetExplorer

public static DesiredCapabilities internetExplorer()

iphone

public static DesiredCapabilities iphone()

ipad

public static DesiredCapabilities ipad()

opera

public static DesiredCapabilities opera()

safari

public static DesiredCapabilities safari()

phantomjs

public static DesiredCapabilities phantomjs()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012. All Rights Reserved.