Enum Class BrowserVersionTrait
- All Implemented Interfaces:
Serializable,Comparable<BrowserVersionTrait>,Constable,BrowserVersionTraitNames,OptionEnum
BrowserVersion that can be configured or queried.
Implements BrowserVersionTraitNames for standardized trait names
and OptionEnum for capability and property management.- Author:
- Scott Babcock, Ronald Brill
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionReturns the value used by the browser for theAccept-Encodingheader.Returns the value used by the browser for theAccept-Languageheader.Returns the application code name, for example "Mozilla".Returns the application minor version, for example "0".Returns the application name, for example "Microsoft Internet Explorer".Returns the application version, for example "4.0 (compatible; MSIE 6.0b; Windows 98)".Returns the browser language, for example "en-US".Returns the value used by the browser for theAcceptheader if requesting a CSS declaration.Returns the value used by the browser for theAcceptheader if requesting a page.Returns the value used by the browser for theAcceptheader if requesting an image.Returnstrueif the browser is currently online.Returns the nickname for the browser represented by this BrowserVersion.Returns the numeric code for the browser represented by this BrowserVersion.Returns the platform on which the application is running, for example "Win32".Returns the value used by the browser for theAcceptheader if requesting a script.Returns the value used by the browser for theSec-CH-UAheader.Returns the value used by the browser for theSec-CH-UA-Platformheader.Returns the systemTimeZone.Returns the user agent string, for example "Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)".Returns the browser vendor, for example "Google Inc.".Returns the value used by the browser for theAcceptheader if performing an XMLHttpRequest. -
Field Summary
Fields inherited from interface org.openqa.selenium.htmlunit.options.BrowserVersionTraitNames
optAcceptEncodingHeader, optAcceptLanguageHeader, optApplicationCodeName, optApplicationMinorVersion, optApplicationName, optApplicationVersion, optBrowserLanguage, optCssAcceptHeader, optHtmlAcceptHeader, optImgAcceptHeader, optIsOnline, optNickname, optNumericCode, optPlatform, optScriptAcceptHeader, optSecClientHintUserAgentHeader, optSecClientHintUserAgentPlatformHeader, optSystemTimezone, optUserAgent, optVendor, optXmlHttpRequestAcceptHeader, SECTION -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(Object value, BrowserVersion.BrowserVersionBuilder builder) Apply the specified value for this trait into the provided browser version builder.voidapplyPropertyTo(Map<String, Object> optionsMap) Apply the value of the system property associated with this trait to the specified options map.Decode the specified value according to the type of this trait.Encode the specified value according to the type of this trait.static BrowserVersionTraitfromCapabilityKey(String key) Returns theBrowserVersionTraitcorresponding to the given capability key.static BrowserVersionTraitfromPropertyName(String name) Returns theBrowserVersionTraitcorresponding to the given property name.Returns the capability key associated with this option.Returns the default value of this option.Class<?>Returns the expected type of this option's value.Returns the property name for this option.booleanisDefaultValue(Object value) Determine if the specified value matches the default for this trait.obtain(BrowserVersion version) Obtain the value for this trait from the specified browser version object.static BrowserVersionTraitReturns the enum constant of this class with the specified name.static BrowserVersionTrait[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NUMERIC_CODE
Returns the numeric code for the browser represented by this BrowserVersion.property: webdriver.htmlunit.numericCode
type:int
default:0 -
NICKNAME
Returns the nickname for the browser represented by this BrowserVersion.property: webdriver.htmlunit.nickname
type:String
default:null -
APPLICATION_VERSION
Returns the application version, for example "4.0 (compatible; MSIE 6.0b; Windows 98)".property: webdriver.htmlunit.applicationVersion
type:String
default:null
see: MSDN documentation -
USER_AGENT
Returns the user agent string, for example "Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)".property: webdriver.htmlunit.userAgent
type:String
default:null -
APPLICATION_NAME
Returns the application name, for example "Microsoft Internet Explorer".property: webdriver.htmlunit.applicationName
type:String
default:null- See Also:
-
APPLICATION_CODE_NAME
Returns the application code name, for example "Mozilla".property: webdriver.htmlunit.applicationCodeName
type:String
default: "Mozilla"
see: MSDN documentation -
APPLICATION_MINOR_VERSION
Returns the application minor version, for example "0".property: webdriver.htmlunit.applicationMinorVersion
type:String
default: "0"
see: MSDN documentation -
VENDOR
Returns the browser vendor, for example "Google Inc.".property: webdriver.htmlunit.vendor
type:String
default: "" -
BROWSER_LANGUAGE
Returns the browser language, for example "en-US".property: webdriver.htmlunit.browserLanguage
type:String
default: "en_US" -
IS_ONLINE
Returnstrueif the browser is currently online.property: webdriver.htmlunit.isOnline
type:boolean
default:true
see: MSDN documentation -
PLATFORM
Returns the platform on which the application is running, for example "Win32".property: webdriver.htmlunit.platform
type:String
default: "Win32"
see: MSDN documentation -
SYSTEM_TIMEZONE
-
ACCEPT_ENCODING_HEADER
Returns the value used by the browser for theAccept-Encodingheader.property: webdriver.htmlunit.acceptEncodingHeader
type:String
default:null -
ACCEPT_LANGUAGE_HEADER
Returns the value used by the browser for theAccept-Languageheader.property: webdriver.htmlunit.acceptLanguageHeader
type:String
default:null -
HTML_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if requesting a page.property: webdriver.htmlunit.htmlAcceptHeader
type:String
default:null -
IMG_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if requesting an image.property: webdriver.htmlunit.imgAcceptHeader
type:String
default:null -
CSS_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if requesting a CSS declaration.property: webdriver.htmlunit.cssAcceptHeader
type:String
default:null -
SCRIPT_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if requesting a script.property: webdriver.htmlunit.scriptAcceptHeader
type:String
default:null -
XML_HTTP_REQUEST_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if performing an XMLHttpRequest.property: webdriver.htmlunit.xmlHttpRequestAcceptHeader
type:String
default:null -
SEC_CLIENT_HINT_USER_AGENT_HEADER
Returns the value used by the browser for theSec-CH-UAheader.property: webdriver.htmlunit.secClientHintUserAgentHeader
type:String
default:null -
SEC_CLIENT_HINT_USER_AGENT_PLATFORM_HEADER
Returns the value used by the browser for theSec-CH-UA-Platformheader.property: webdriver.htmlunit.secClientHintUserAgentPlatformHeader
type:String
default:null
-
-
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
-
getCapabilityKey
Description copied from interface:OptionEnumReturns the capability key associated with this option.- Specified by:
getCapabilityKeyin interfaceOptionEnum- Returns:
- the capability key
-
getPropertyName
Description copied from interface:OptionEnumReturns the property name for this option.- Specified by:
getPropertyNamein interfaceOptionEnum- Returns:
- the property name
-
getOptionType
Description copied from interface:OptionEnumReturns the expected type of this option's value.- Specified by:
getOptionTypein interfaceOptionEnum- Returns:
- the option type
-
getDefaultValue
Description copied from interface:OptionEnumReturns the default value of this option.- Specified by:
getDefaultValuein interfaceOptionEnum- Returns:
- the default value
-
isDefaultValue
Determine if the specified value matches the default for this trait.- Specified by:
isDefaultValuein interfaceOptionEnum- Parameters:
value- value to be evaluated- Returns:
trueif specified value matches the default value; otherwisefalse
-
applyPropertyTo
Apply the value of the system property associated with this trait to the specified options map.- Specified by:
applyPropertyToin interfaceOptionEnum- Parameters:
optionsMap- browser version options map
-
encode
Encode the specified value according to the type of this trait.- Specified by:
encodein interfaceOptionEnum- Parameters:
value- value to be encoded- Returns:
- trait-specific encoding for specified value
-
decode
Decode the specified value according to the type of this trait.- Specified by:
decodein interfaceOptionEnum- Parameters:
value- value to be decoded- Returns:
- trait-specific decoding for specified value
-
apply
Apply the specified value for this trait into the provided browser version builder.- Parameters:
value- value to be insertedbuilder-BrowserVersion.BrowserVersionBuilderobject
-
obtain
Obtain the value for this trait from the specified browser version object.- Parameters:
version-BrowserVersionobject- Returns:
- value for this trait
-
fromCapabilityKey
Returns theBrowserVersionTraitcorresponding to the given capability key.- Parameters:
key- the capability key to look up- Returns:
- the matching BrowserVersionTrait, or
nullif none matches
-
fromPropertyName
Returns theBrowserVersionTraitcorresponding to the given property name.- Parameters:
name- the property name to look up- Returns:
- the matching BrowserVersionTrait, or
nullif none matches
-