org.openqa.selenium
Enum Platform

java.lang.Object
  extended by java.lang.Enum<Platform>
      extended by org.openqa.selenium.Platform
All Implemented Interfaces:
Serializable, Comparable<Platform>

public enum Platform
extends Enum<Platform>

Represents the known and supported Platforms that WebDriver runs on. This is pretty close to the Operating System, but differs slightly, because this class is used to extract information such as program locations and line endings.


Enum Constant Summary
ANDROID
           
ANY
          Never returned, but can be used to request a browser running on any operating system
LINUX
           
MAC
           
UNIX
           
VISTA
          For versions of Windows that "feel like" Windows Vista.
WINDOWS
          Never returned, but can be used to request a browser running on any version of Windows.
XP
          For versions of Windows that "feel like" Windows XP.
 
Method Summary
static Platform extractFromSysProperty(String osName)
           
static Platform getCurrent()
           
 int getMajorVersion()
           
 int getMinorVersion()
           
 String[] getPartOfOsName()
           
 boolean is(Platform compareWith)
           
static Platform valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Platform[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

WINDOWS

public static final Platform WINDOWS
Never returned, but can be used to request a browser running on any version of Windows.


XP

public static final Platform XP
For versions of Windows that "feel like" Windows XP. These are ones that store files in "\Program Files\" and documents under "\\documents and settings\\username"


VISTA

public static final Platform VISTA
For versions of Windows that "feel like" Windows Vista.


MAC

public static final Platform MAC

UNIX

public static final Platform UNIX

LINUX

public static final Platform LINUX

ANDROID

public static final Platform ANDROID

ANY

public static final Platform ANY
Never returned, but can be used to request a browser running on any operating system

Method Detail

values

public static Platform[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Platform c : Platform.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Platform valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getPartOfOsName

public String[] getPartOfOsName()

getCurrent

public static Platform getCurrent()

extractFromSysProperty

public static Platform extractFromSysProperty(String osName)

is

public boolean is(Platform compareWith)

getMajorVersion

public int getMajorVersion()

getMinorVersion

public int getMinorVersion()


Copyright © 2011. All Rights Reserved.