Enum BrowserVersionTrait

    • Enum Constant Detail

      • NUMERIC_CODE

        public static final BrowserVersionTrait NUMERIC_CODE
        Returns the numeric code for the browser represented by this BrowserVersion.

        property: webdriver.htmlunit.numericCode
        type: int
        default: 0

      • NICKNAME

        public static final BrowserVersionTrait NICKNAME
        Returns the nickname for the browser represented by this BrowserVersion.

        property: webdriver.htmlunit.nickname
        type: String
        default: null

      • APPLICATION_VERSION

        public static final BrowserVersionTrait 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

        public static final BrowserVersionTrait 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

        public static final BrowserVersionTrait APPLICATION_NAME
        Returns the application name, for example "Microsoft Internet Explorer".

        property: webdriver.htmlunit.applicationName
        type: String
        default: null

        See Also:
        MSDN documentation
      • APPLICATION_CODE_NAME

        public static final BrowserVersionTrait 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

        public static final BrowserVersionTrait APPLICATION_MINOR_VERSION
        Returns the application minor version, for example "0".

        property: webdriver.htmlunit.applicationMinorVersion
        type: String
        default: "0"
        see: MSDN documentation

      • VENDOR

        public static final BrowserVersionTrait VENDOR
        Returns the browser vendor, for example "Google Inc.".

        property: webdriver.htmlunit.vendor
        type: String
        default: ""

      • BROWSER_LANGUAGE

        public static final BrowserVersionTrait BROWSER_LANGUAGE
        Returns the browser language, for example "en-US".

        property: webdriver.htmlunit.browserLanguage
        type: String
        default: "en_US"

      • IS_ONLINE

        public static final BrowserVersionTrait IS_ONLINE
        Returns true if the browser is currently online.

        property: webdriver.htmlunit.isOnline
        type: boolean
        default: true
        see: MSDN documentation

      • PLATFORM

        public static final BrowserVersionTrait 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

        public static final BrowserVersionTrait SYSTEM_TIMEZONE
        Returns the system TimeZone.

        property: webdriver.htmlunit.systemTimezone
        type: TimeZone
        default: TimeZone.getTimeZone("America/New_York")

      • ACCEPT_ENCODING_HEADER

        public static final BrowserVersionTrait ACCEPT_ENCODING_HEADER
        Returns the value used by the browser for the Accept-Encoding header.

        property: webdriver.htmlunit.acceptEncodingHeader
        type: String
        default: null

      • ACCEPT_LANGUAGE_HEADER

        public static final BrowserVersionTrait ACCEPT_LANGUAGE_HEADER
        Returns the value used by the browser for the Accept-Language header.

        property: webdriver.htmlunit.acceptLanguageHeader
        type: String
        default: null

      • HTML_ACCEPT_HEADER

        public static final BrowserVersionTrait HTML_ACCEPT_HEADER
        Returns the value used by the browser for the Accept header if requesting a page.

        property: webdriver.htmlunit.htmlAcceptHeader
        type: String
        default: null

      • IMG_ACCEPT_HEADER

        public static final BrowserVersionTrait IMG_ACCEPT_HEADER
        Returns the value used by the browser for the Accept header if requesting an image.

        property: webdriver.htmlunit.imgAcceptHeader
        type: String
        default: null

      • CSS_ACCEPT_HEADER

        public static final BrowserVersionTrait CSS_ACCEPT_HEADER
        Returns the value used by the browser for the Accept header if requesting a CSS declaration.

        property: webdriver.htmlunit.cssAcceptHeader
        type: String
        default: null

      • SCRIPT_ACCEPT_HEADER

        public static final BrowserVersionTrait SCRIPT_ACCEPT_HEADER
        Returns the value used by the browser for the Accept header if requesting a script.

        property: webdriver.htmlunit.scriptAcceptHeader
        type: String
        default: null

      • XML_HTTP_REQUEST_ACCEPT_HEADER

        public static final BrowserVersionTrait XML_HTTP_REQUEST_ACCEPT_HEADER
        Returns the value used by the browser for the Accept header if performing an XMLHttpRequest.

        property: webdriver.htmlunit.xmlHttpRequestAcceptHeader
        type: String
        default: null

      • SEC_CLIENT_HINT_USER_AGENT_HEADER

        public static final BrowserVersionTrait SEC_CLIENT_HINT_USER_AGENT_HEADER
        Returns the value used by the browser for the Sec-CH-UA header.

        property: webdriver.htmlunit.secClientHintUserAgentHeader
        type: String
        default: null

      • SEC_CLIENT_HINT_USER_AGENT_PLATFORM_HEADER

        public static final BrowserVersionTrait SEC_CLIENT_HINT_USER_AGENT_PLATFORM_HEADER
        Returns the value used by the browser for the Sec-CH-UA-Platform header.

        property: webdriver.htmlunit.secClientHintUserAgentPlatformHeader
        type: String
        default: null

    • Method Detail

      • values

        public static BrowserVersionTrait[] 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 (BrowserVersionTrait c : BrowserVersionTrait.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BrowserVersionTrait 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
      • isDefaultValue

        public boolean isDefaultValue​(Object value)
        Determine if the specified value matches the default for this trait.
        Specified by:
        isDefaultValue in interface OptionEnum
        Parameters:
        value - value to be evaluated
        Returns:
        true if specified value matches the default value; otherwise false
      • applyPropertyTo

        public void applyPropertyTo​(Map<String,​Object> optionsMap)
        Apply the value of the system property associated with this trait to the specified options map.
        Specified by:
        applyPropertyTo in interface OptionEnum
        Parameters:
        optionsMap - browser version options map
      • encode

        public Object encode​(Object value)
        Encode the specified value according to the type of this trait.
        Specified by:
        encode in interface OptionEnum
        Parameters:
        value - value to be encoded
        Returns:
        trait-specific encoding for specified value
      • decode

        public Object decode​(Object value)
        Decode the specified value according to the type of this trait.
        Specified by:
        decode in interface OptionEnum
        Parameters:
        value - value to be decoded
        Returns:
        trait-specific decoding for specified value
      • obtain

        public Object obtain​(BrowserVersion version)
        Obtain the value for this trait from the specified browser version object.
        Parameters:
        version - BrowserVersion object
        Returns:
        value for this trait