org.openqa.selenium.remote
Class DesiredCapabilities
java.lang.Object
org.openqa.selenium.remote.DesiredCapabilities
- All Implemented Interfaces:
- Serializable, Capabilities
public class DesiredCapabilities
- extends Object
- implements Serializable, Capabilities
- See Also:
- Serialized Form
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)
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.