Package org.openqa.selenium
Enum Class Platform
- All Implemented Interfaces:
Serializable
,Comparable<Platform>
,Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionNever returned, but can be used to request a browser running on any operating system.Many platforms have UNIX traits, amongst them LINUX, Solaris and BSD.For versions of Windows that "feel like" Windows Vista.For versions of Windows that "feel like" Windows 8.Never returned, but can be used to request a browser running on any version of Windows.For versions of Windows that "feel like" Windows XP. -
Method Summary
Modifier and TypeMethodDescriptionstatic Platform
extractFromSysProperty
(String osName) Extracts platforms based on system properties in Java and uses a heuristic to determine the most likely operating system.static Platform
extractFromSysProperty
(String osName, String osVersion) Extracts platforms based on system properties in Java and uses a heuristic to determine the most likely operating system.abstract Platform
family()
Returns a platform that represents a family for the current platform.static Platform
fromString
(String name) Gets a platform with the name matching the parameter.static Platform
Get current platform (not necessarily the same as operating system).int
Returns the major version of this platform.int
Returns the minor version of this platform.String[]
boolean
Heuristic for comparing two platforms.static Platform
Returns the enum constant of this class with the specified name.static Platform[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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. These are ones that store files in "\Program Files\" and documents under "\\documents and settings\\username" -
VISTA
For versions of Windows that "feel like" Windows Vista. -
WIN7
-
WIN8
For versions of Windows that "feel like" Windows 8. -
WIN8_1
-
WIN10
-
WIN11
-
MAC
-
SNOW_LEOPARD
-
MOUNTAIN_LION
-
MAVERICKS
-
YOSEMITE
-
EL_CAPITAN
-
SIERRA
-
HIGH_SIERRA
-
MOJAVE
-
CATALINA
-
BIG_SUR
-
MONTEREY
-
VENTURA
-
SONOMA
-
UNIX
Many platforms have UNIX traits, amongst them LINUX, Solaris and BSD. -
LINUX
-
ANDROID
-
IOS
-
ANY
Never returned, but can be used to request a browser running on any operating system.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getCurrent
Get current platform (not necessarily the same as operating system).- Returns:
- current platform
-
extractFromSysProperty
Extracts platforms based on system properties in Java and uses a heuristic to determine the most likely operating system. If unable to determine the operating system, it will default to UNIX.- Parameters:
osName
- the operating system name to determine the platform of- Returns:
- the most likely platform based on given operating system name
-
extractFromSysProperty
Extracts platforms based on system properties in Java and uses a heuristic to determine the most likely operating system. If unable to determine the operating system, it will default to UNIX.- Parameters:
osName
- the operating system name to determine the platform ofosVersion
- the operating system version to determine the platform of- Returns:
- the most likely platform based on given operating system name and version
-
fromString
Gets a platform with the name matching the parameter.- Parameters:
name
- the platform name- Returns:
- the Platform enum value matching the parameter
-
getPartOfOsName
-
is
Heuristic for comparing two platforms. If platforms (which is not the same thing as operating systems) are found to be approximately similar in nature, this will return true. For instance the LINUX platform is similar to UNIX, and will give a positive result if compared.- Parameters:
compareWith
- the platform to compare with- Returns:
- true if platforms are approximately similar, false otherwise
-
family
Returns a platform that represents a family for the current platform. For instance the LINUX if a part of the UNIX family, the XP is a part of the WINDOWS family.- Returns:
- the family platform for the current one, or
null
if thisPlatform
represents a platform family (such as Windows, or MacOS)
-
getMajorVersion
public int getMajorVersion()Returns the major version of this platform.- Returns:
- the major version of specified platform
-
getMinorVersion
public int getMinorVersion()Returns the minor version of this platform.- Returns:
- the minor version of specified platform
-