Enum Class HtmlUnitOption
- All Implemented Interfaces:
Serializable,Comparable<HtmlUnitOption>,Constable,HtmlUnitOptionNames,OptionEnum
- 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 ConstantDescriptionSets theconnTimeToLive(in milliseconds) of theHttpClientconnection pool.Enables/disables CSS support.Enables/disables "Do Not Track" support.Sets whether or not to automatically download images.Sets whether or not fetch polyfill should be used.Sets whether or not the file protocol is allowed for XMLHttpRequests.Enables/disables geo-location support.Sets the maximum number ofpagesto cache in history.Sets the maximum number ofpagesto cache in history.Sets the client's home page.Sets whether or not redirections will be followed automatically on receipt of a redirect status code from the server.Enables/disables JavaScript support.Sets the local address to be used for request execution.Sets the maximum bytes to have in memory, after which the content is saved to a temporary file.
NOTE: Set this to zero or -1 to deactivate the saving at all.Enable/disable the popup window blocker.Specifies whether or not the content of the resulting document will be printed to the console in the event of a failing response code.Sets the proxy configuration for this client.Sets the screen height.Sets the screen width.Password for the specified SSL client certificate KeyStore.The SSL client certificate KeyStore to use.Type of the specified SSL client certificate KeyStore (e.g. -jksorpkcs12).Sets the cipher suites enabled for use on SSL connections.Sets the protocol versions enabled for use on SSL connections.Sets the SSL protocol, used only whenUSE_INSECURE_SSLis set totrue.The SSL server certificate trust store.Password for the specified SSL trust KeyStore.Type of the specified SSL trust KeyStore (e.g. -jksorpkcs12).Path to the directory to be used for storing the response content in a temporary file.Specifies whether or not an exception will be thrown in the event of a failing status code.Indicates if an exception should be thrown when a script execution fails or if it should be caught and just logged to allow page execution to continue.Sets the timeout of theWebConnection.If set totrue, the client will accept connections to any host, regardless of whether they have valid certificates or not.WEB_CLIENT_VERSION(optWebClientVersion, BrowserVersion.class, BrowserVersion.BEST_SUPPORTED).Enables/disables WebSocket support.Sets the WebSocketmaxBinaryMessageSize.Sets the WebSocketmaxTextMessageSize. -
Field Summary
Fields inherited from interface org.openqa.selenium.htmlunit.options.HtmlUnitOptionNames
optConnectionTimeToLive, optCssEnabled, optDoNotTrackEnabled, optDownloadImages, optFetchPolyfillEnabled, optFileProtocolForXMLHttpRequestsAllowed, optGeolocationEnabled, optHistoryPageCacheLimit, optHistorySizeLimit, optHomePage, optIsRedirectEnabled, optJavaScriptEnabled, optLocalAddress, optMaxInMemory, optPopupBlockerEnabled, optPrintContentOnFailingStatusCode, optProxyConfig, optScreenHeight, optScreenWidth, optSslClientCertificatePassword, optSslClientCertificateStore, optSslClientCertificateType, optSslClientCipherSuites, optSslClientProtocols, optSslInsecureProtocol, optSslTrustStore, optSslTrustStorePassword, optSslTrustStoreType, optTempFileDirectory, optThrowExceptionOnFailingStatusCode, optThrowExceptionOnScriptError, optTimeout, optUseInsecureSSL, optWebClientVersion, optWebSocketEnabled, optWebSocketMaxBinaryMessageBufferSize, optWebSocketMaxBinaryMessageSize, optWebSocketMaxTextMessageBufferSize, optWebSocketMaxTextMessageSize, SECTION -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPropertyTo(Map<String, Object> optionsMap) Applies this option's value to the given options map.Decode the specified value according to the type of this option.Encode the specified value according to the type of this option.static HtmlUnitOptionfromCapabilityKey(String key) Get the enumerated constant for the specified option key name.static HtmlUnitOptionfromPropertyName(String name) Get the enumerated constant for the specified system 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.voidinsert(WebClientOptions options, Object value) Insert the specified value for this option into the provided web client options object.booleanisDefaultValue(Object value) Determine if the specified value matches the default for this option.obtain(WebClientOptions options) Obtain the value for this option from the specified web client options object.static HtmlUnitOptionReturns the enum constant of this class with the specified name.static HtmlUnitOption[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WEB_CLIENT_VERSION
WEB_CLIENT_VERSION(optWebClientVersion, BrowserVersion.class, BrowserVersion.BEST_SUPPORTED). -
JAVASCRIPT_ENABLED
Enables/disables JavaScript support.property: webdriver.htmlunit.javaScriptEnabled
type:boolean
default:true -
CSS_ENABLED
Enables/disables CSS support. If disabled, HtmlUnit will not download linked CSS files and also not trigger the associatedonload/onerrorevents.property: webdriver.htmlunit.cssEnabled
type:boolean
default:true -
PRINT_CONTENT_ON_FAILING_STATUS_CODE
Specifies whether or not the content of the resulting document will be printed to the console in the event of a failing response code. Successful response codes are in the range 200-299.property: webdriver.htmlunit.printContentOnFailingStatusCode
type:boolean
default:true -
THROW_EXCEPTION_ON_FAILING_STATUS_CODE
Specifies whether or not an exception will be thrown in the event of a failing status code. Successful status codes are in the range 200-299.property: webdriver.htmlunit.throwExceptionOnFailingStatusCode
type:boolean
default:true -
THROW_EXCEPTION_ON_SCRIPT_ERROR
Indicates if an exception should be thrown when a script execution fails or if it should be caught and just logged to allow page execution to continue.property: webdriver.htmlunit.throwExceptionOnScriptError
type:boolean
default:true -
POPUP_BLOCKER_ENABLED
Enable/disable the popup window blocker. By default, the popup blocker is disabled, and popup windows are allowed. When set totrue, thewindow.open()function has no effect and returnsnull.property: webdriver.htmlunit.popupBlockerEnabled
type:boolean
default:false -
IS_REDIRECT_ENABLED
Sets whether or not redirections will be followed automatically on receipt of a redirect status code from the server.property: webdriver.htmlunit.isRedirectEnabled
type:boolean
default:true(enable automatic redirection) -
TEMP_FILE_DIRECTORY
Path to the directory to be used for storing the response content in a temporary file. The specified directory is created if it doesn't exist.property: webdriver.htmlunit.tempFileDirectory
type:File
default:null(use system default)
see:setMaxInMemory -
SSL_CLIENT_CERTIFICATE_STORE
The SSL client certificate KeyStore to use.NOTE: This option is omitted when serializing session settings. The SSL client certificate key store type is serialized via SSL_CLIENT_CERTIFICATE_TYPE and the SSL client certificate key store password is serialized via SSL_CLIENT_CERTIFICATE_PASSWORD
property: webdriver.htmlunit.sslClientCertificateStore
type:KeyStore
default:null
see:SSL_CLIENT_CERTIFICATE_TYPE
see:SSL_CLIENT_CERTIFICATE_PASSWORD -
SSL_CLIENT_CERTIFICATE_TYPE
Type of the specified SSL client certificate KeyStore (e.g. -jksorpkcs12).property: webdriver.htmlunit.sslClientCertificateType
type: char[]
default:null
see:SSL_CLIENT_CERTIFICATE_STORE
see:SSL_CLIENT_CERTIFICATE_PASSWORD
see:Security.getProviders() -
SSL_CLIENT_CERTIFICATE_PASSWORD
Password for the specified SSL client certificate KeyStore.property: webdriver.htmlunit.sslClientCertificatePassword
type: char[]
default:null
see:SSL_CLIENT_CERTIFICATE_STORE
see:SSL_CLIENT_CERTIFICATE_TYPE -
SSL_TRUST_STORE
The SSL server certificate trust store. All server certificates will be validated against this trust store.NOTE: This option is omitted when serializing session settings. The SSL server certificate trust store type is serialized via SSL_TRUST_STORE_TYPE and the SSL server certificate trust store password is serialized via SSL_TRUST_STORE_PASSWORD
property: webdriver.htmlunit.sslTrustStore
type:KeyStore
default:null
see:SSL_TRUST_STORE_TYPE
see:SSL_TRUST_STORE_PASSWORD -
SSL_TRUST_STORE_TYPE
Type of the specified SSL trust KeyStore (e.g. -jksorpkcs12).property: webdriver.htmlunit.sslTrustStoreType
type: char[]
default:null
see:SSL_TRUST_STORE
see:SSL_TRUST_STORE_PASSWORD
see:Security.getProviders -
SSL_TRUST_STORE_PASSWORD
Password for the specified SSL trust KeyStore.property: webdriver.htmlunit.sslTrustStorePassword
type: char[]
default:null
see:SSL_TRUST_STORE
see:SSL_TRUST_STORE_TYPE -
SSL_CLIENT_PROTOCOLS
Sets the protocol versions enabled for use on SSL connections.property: webdriver.htmlunit.sslClientProtocols
type: String[]
default:null(use default protocols)
see:SSLSocket.setEnabledProtocols -
SSL_CLIENT_CIPHER_SUITES
Sets the cipher suites enabled for use on SSL connections.property: webdriver.htmlunit.sslClientCipherSuites
type: String[]
default:null(use default cipher suites)
see:SSLSocket.setEnabledCipherSuites -
GEOLOCATION_ENABLED
Enables/disables geo-location support.property: webdriver.htmlunit.geolocationEnabled
type:boolean
default:false -
DO_NOT_TRACK_ENABLED
Enables/disables "Do Not Track" support.property: webdriver.htmlunit.doNotTrackEnabled
type:boolean
default:false -
HOME_PAGE
Sets the client's home page.property: webdriver.htmlunit.homePage
type:String
default: "https://www.htmlunit.org/" -
PROXY_CONFIG
Sets the proxy configuration for this client.property: webdriver.htmlunit.proxyConfig
type:ProxyConfig
default:null -
TIMEOUT
Sets the timeout of theWebConnection. Set to zero for an infinite wait.NOTE: The timeout is used twice. The first is for making the socket connection, the second is for data retrieval. If the time is critical you must allow for twice the time specified here.
property: webdriver.htmlunit.timeout
type:int
default: 90_000 (1.5 minutes in milliseconds) -
CONNECTION_TIME_TO_LIVE
Sets theconnTimeToLive(in milliseconds) of theHttpClientconnection pool. Use this if you are working with web pages behind a DNS based load balancer.property: webdriver.htmlunit.connectionTimeToLive
type:long
default: -1 (use HTTP default) -
USE_INSECURE_SSL
If set totrue, the client will accept connections to any host, regardless of whether they have valid certificates or not. This is especially useful when you are trying to connect to a server with expired or corrupt certificates.property: webdriver.htmlunit.useInsecureSSL
type:boolean
default:false -
SSL_INSECURE_PROTOCOL
Sets the SSL protocol, used only whenUSE_INSECURE_SSLis set totrue.property: webdriver.htmlunit.sslInsecureProtocol
type:String
default:null(use default protocol: SSL)
seeSSLContextAlgorithms -
MAX_IN_MEMORY
Sets the maximum bytes to have in memory, after which the content is saved to a temporary file.
NOTE: Set this to zero or -1 to deactivate the saving at all.property: webdriver.htmlunit.maxInMemory
type:int
default: 500 * 1024 -
HISTORY_SIZE_LIMIT
Sets the maximum number ofpagesto cache in history. HtmlUnit usesSoftReference<Page>for storing the pages that are part of the history. If you like to fine tune this you can useHISTORY_PAGE_CACHE_LIMITto limit the number of page references stored by the history.property: webdriver.htmlunit.historySizeLimit
type:int
default: 50
see:SoftReference -
HISTORY_PAGE_CACHE_LIMIT
Sets the maximum number ofpagesto cache in history. If this value is smaller thanHISTORY_SIZE_LIMIT, HtmlUnit will only use soft references for the first HISTORY_PAGE_CACHE_LIMIT entries in the history. For older entries, only the URL is saved; the page will be (re)retrieved on demand.property: webdriver.htmlunit.historyPageCacheLimit
type:int
default:Integer.MAX_VALUE -
LOCAL_ADDRESS
Sets the local address to be used for request execution.On machines with multiple network interfaces, this parameter can be used to select the network interface from which the connection originates.
property: webdriver.htmlunit.localAddress
type:InetAddress
default:null(use default 'localhost') -
DOWNLOAD_IMAGES
Sets whether or not to automatically download images.property: webdriver.htmlunit.downloadImages
type:boolean
default:false -
SCREEN_WIDTH
Sets the screen width.property: webdriver.htmlunit.screenWidth
type:int
default: 1920 -
SCREEN_HEIGHT
Sets the screen height.property: webdriver.htmlunit.screenHeight
type:int
default: 1080 -
WEB_SOCKET_ENABLED
Enables/disables WebSocket support.property: webdriver.htmlunit.webSocketEnabled
type:boolean
default:true -
WEB_SOCKET_MAX_TEXT_MESSAGE_SIZE
Sets the WebSocketmaxTextMessageSize.property: webdriver.htmlunit.webSocketMaxTextMessageSize
type:int
default: -1 (use default size) -
WEB_SOCKET_MAX_BINARY_MESSAGE_SIZE
Sets the WebSocketmaxBinaryMessageSize.property: webdriver.htmlunit.webSocketMaxBinaryMessageSize
type:int
default: -1 (use default size) -
FETCH_POLYFILL_ENABLED
Sets whether or not fetch polyfill should be used.property: webdriver.htmlunit.fetchPolyfillEnabled
type:boolean
default:false -
FILE_PROTOCOL_FOR_XMLHTTPREQUESTS_ALLOWED
Sets whether or not the file protocol is allowed for XMLHttpRequests.NOTE: If set to
true, the client will accept XMLHttpRequests to URLs using the 'file' protocol. Allowing this introduces security problems and is therefore not allowed by current browsers. But some browsers have special settings to open this door; therefore, we have this option.property: webdriver.htmlunit.fileProtocolForXMLHttpRequestsAllowed
type:boolean
default:false
-
-
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 option.- Specified by:
isDefaultValuein interfaceOptionEnum- Parameters:
value- value to be evaluated- Returns:
trueif specified value matches the default value; otherwisefalse
-
applyPropertyTo
Applies this option's value to the given options map.- Specified by:
applyPropertyToin interfaceOptionEnum- Parameters:
optionsMap- the map of options to update
-
encode
Encode the specified value according to the type of this option.- Specified by:
encodein interfaceOptionEnum- Parameters:
value- value to be encoded- Returns:
- option-specific encoding for specified value
-
decode
Decode the specified value according to the type of this option.- Specified by:
decodein interfaceOptionEnum- Parameters:
value- value to be decoded- Returns:
- option-specific decoding for specified value
-
insert
Insert the specified value for this option into the provided web client options object.- Parameters:
options-WebClientOptionsobjectvalue- value to be inserted
-
obtain
Obtain the value for this option from the specified web client options object.- Parameters:
options-WebClientOptionsobject- Returns:
- value for this option
-
fromCapabilityKey
Get the enumerated constant for the specified option key name.- Parameters:
key- option key name- Returns:
HtmlUnitOptionconstant for option key;nullif constant not found
-
fromPropertyName
Get the enumerated constant for the specified system property name.- Parameters:
name- system property name- Returns:
HtmlUnitOptionconstant for property name;nullif constant not found
-