Enum HtmlUnitOption
- java.lang.Object
 - 
- java.lang.Enum<HtmlUnitOption>
 - 
- org.openqa.selenium.htmlunit.options.HtmlUnitOption
 
 
 
- 
- All Implemented Interfaces:
 Serializable,Comparable<HtmlUnitOption>,HtmlUnitOptionNames,OptionEnum
public enum HtmlUnitOption extends Enum<HtmlUnitOption> implements HtmlUnitOptionNames, OptionEnum
- Author:
 - Scott Babcock, Ronald Brill
 
 
- 
- 
Enum Constant Summary
Enum Constants Enum Constant Description CONNECTION_TIME_TO_LIVESets theconnTimeToLive(in milliseconds) of theHttpClientconnection pool.CSS_ENABLEDEnables/disables CSS support.DO_NOT_TRACK_ENABLEDEnables/disables "Do Not Track" support.DOWNLOAD_IMAGESSets whether or not to automatically download images.FETCH_POLYFILL_ENABLEDSets whether or not fetch polyfill should be used.FILE_PROTOCOL_FOR_XMLHTTPREQUESTS_ALLOWEDSets whether or not the file protocol is allowed for XMLHttpRequests.GEOLOCATION_ENABLEDEnables/disables geo-location support.HISTORY_PAGE_CACHE_LIMITSets the maximum number ofpagesto cache in history.HISTORY_SIZE_LIMITSets the maximum number ofpagesto cache in history.HOME_PAGESets the client's home page.IS_REDIRECT_ENABLEDSets whether or not redirections will be followed automatically on receipt of a redirect status code from the server.JAVASCRIPT_ENABLEDEnables/disables JavaScript support.LOCAL_ADDRESSSets the local address to be used for request execution.MAX_IN_MEMORYSets 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.POPUP_BLOCKER_ENABLEDEnable/disable the popup window blocker.PRINT_CONTENT_ON_FAILING_STATUS_CODESpecifies whether or not the content of the resulting document will be printed to the console in the event of a failing response code.PROXY_CONFIGSets the proxy configuration for this client.SCREEN_HEIGHTSets the screen height.SCREEN_WIDTHSets the screen width.SSL_CLIENT_CERTIFICATE_PASSWORDPassword for the specified SSL client certificate KeyStore.SSL_CLIENT_CERTIFICATE_STOREThe SSL client certificate KeyStore to use.SSL_CLIENT_CERTIFICATE_TYPEType of the specified SSL client certificate KeyStore (e.g. -jksorpkcs12).SSL_CLIENT_CIPHER_SUITESSets the cipher suites enabled for use on SSL connections.SSL_CLIENT_PROTOCOLSSets the protocol versions enabled for use on SSL connections.SSL_INSECURE_PROTOCOLSets the SSL protocol, used only whenUSE_INSECURE_SSLis set totrue.SSL_TRUST_STOREThe SSL server certificate trust store.SSL_TRUST_STORE_PASSWORDPassword for the specified SSL trust KeyStore.SSL_TRUST_STORE_TYPEType of the specified SSL trust KeyStore (e.g. -jksorpkcs12).TEMP_FILE_DIRECTORYPath to the directory to be used for storing the response content in a temporary file.THROW_EXCEPTION_ON_FAILING_STATUS_CODESpecifies whether or not an exception will be thrown in the event of a failing status code.THROW_EXCEPTION_ON_SCRIPT_ERRORIndicates 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.TIMEOUTSets the timeout of theWebConnection.USE_INSECURE_SSLIf set totrue, the client will accept connections to any host, regardless of whether they have valid certificates or not.WEB_CLIENT_VERSIONWEB_CLIENT_VERSION(optWebClientVersion, BrowserVersion.class, BrowserVersion.BEST_SUPPORTED).WEB_SOCKET_ENABLEDEnables/disables WebSocket support.WEB_SOCKET_MAX_BINARY_MESSAGE_BUFFER_SIZESets the WebSocketmaxBinaryMessageBufferSize.WEB_SOCKET_MAX_BINARY_MESSAGE_SIZESets the WebSocketmaxBinaryMessageSize.WEB_SOCKET_MAX_TEXT_MESSAGE_BUFFER_SIZESets the WebSocketmaxTextMessageBufferSize.WEB_SOCKET_MAX_TEXT_MESSAGE_SIZESets 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyPropertyTo(Map<String,Object> optionsMap)Objectdecode(Object value)Decode the specified value according to the type of this option.Objectencode(Object value)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.StringgetCapabilityKey()ObjectgetDefaultValue()Class<?>getOptionType()StringgetPropertyName()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.Objectobtain(WebClientOptions options)Obtain the value for this option from the specified web client options object.static HtmlUnitOptionvalueOf(String name)Returns the enum constant of this type with the specified name.static HtmlUnitOption[]values()Returns an array containing the constants of this enum type, in the order they are declared. 
 - 
 
- 
- 
Enum Constant Detail
- 
WEB_CLIENT_VERSION
public static final HtmlUnitOption WEB_CLIENT_VERSION
WEB_CLIENT_VERSION(optWebClientVersion, BrowserVersion.class, BrowserVersion.BEST_SUPPORTED). 
- 
JAVASCRIPT_ENABLED
public static final HtmlUnitOption JAVASCRIPT_ENABLED
Enables/disables JavaScript support.property: webdriver.htmlunit.javaScriptEnabled
type:boolean
default:true 
- 
CSS_ENABLED
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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 if doesn't exist.property: webdriver.htmlunit.tempFileDirectory
type:File
default:null(use system default)
see:setMaxInMemory 
- 
SSL_CLIENT_CERTIFICATE_STORE
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption GEOLOCATION_ENABLED
Enables/disables geo-location support.property: webdriver.htmlunit.geolocationEnabled
type:boolean
default:false 
- 
DO_NOT_TRACK_ENABLED
public static final HtmlUnitOption DO_NOT_TRACK_ENABLED
Enables/disables "Do Not Track" support.property: webdriver.htmlunit.doNotTrackEnabled
type:boolean
default:false 
- 
HOME_PAGE
public static final HtmlUnitOption HOME_PAGE
Sets the client's home page.property: webdriver.htmlunit.homePage
type:String
default: "https://www.htmlunit.org/" 
- 
PROXY_CONFIG
public static final HtmlUnitOption PROXY_CONFIG
Sets the proxy configuration for this client.property: webdriver.htmlunit.proxyConfig
type:ProxyConfig
default:null 
- 
TIMEOUT
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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
public static final HtmlUnitOption DOWNLOAD_IMAGES
Sets whether or not to automatically download images.property: webdriver.htmlunit.downloadImages
type:boolean
default:false 
- 
SCREEN_WIDTH
public static final HtmlUnitOption SCREEN_WIDTH
Sets the screen width.property: webdriver.htmlunit.screenWidth
type:int
default: 1920 
- 
SCREEN_HEIGHT
public static final HtmlUnitOption SCREEN_HEIGHT
Sets the screen height.property: webdriver.htmlunit.screenHeight
type:int
default: 1080 
- 
WEB_SOCKET_ENABLED
public static final HtmlUnitOption WEB_SOCKET_ENABLED
Enables/disables WebSocket support.property: webdriver.htmlunit.webSocketEnabled
type:boolean
default:true 
- 
WEB_SOCKET_MAX_TEXT_MESSAGE_SIZE
public static final HtmlUnitOption WEB_SOCKET_MAX_TEXT_MESSAGE_SIZE
Sets the WebSocketmaxTextMessageSize.property: webdriver.htmlunit.webSocketMaxTextMessageSize
type:int
default: -1 {use default size) 
- 
WEB_SOCKET_MAX_TEXT_MESSAGE_BUFFER_SIZE
public static final HtmlUnitOption WEB_SOCKET_MAX_TEXT_MESSAGE_BUFFER_SIZE
Sets the WebSocketmaxTextMessageBufferSize.property: webdriver.htmlunit.webSocketMaxTextMessageBufferSize
type:int
default: -1 {use default size) 
- 
WEB_SOCKET_MAX_BINARY_MESSAGE_SIZE
public static final HtmlUnitOption WEB_SOCKET_MAX_BINARY_MESSAGE_SIZE
Sets the WebSocketmaxBinaryMessageSize.property: webdriver.htmlunit.webSocketMaxBinaryMessageSize
type:int
default: -1 {use default size) 
- 
WEB_SOCKET_MAX_BINARY_MESSAGE_BUFFER_SIZE
public static final HtmlUnitOption WEB_SOCKET_MAX_BINARY_MESSAGE_BUFFER_SIZE
Sets the WebSocketmaxBinaryMessageBufferSize.property: webdriver.htmlunit.webSocketMaxBinaryMessageBufferSize
type:int
default: -1 {use default size) 
- 
FETCH_POLYFILL_ENABLED
public static final HtmlUnitOption 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
public static final HtmlUnitOption 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 Detail
- 
values
public static HtmlUnitOption[] 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 (HtmlUnitOption c : HtmlUnitOption.values()) System.out.println(c);
- Returns:
 - an array containing the constants of this enum type, in the order they are declared
 
 
- 
valueOf
public static HtmlUnitOption 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 nameNullPointerException- if the argument is null
 
- 
getCapabilityKey
public String getCapabilityKey()
- Specified by:
 getCapabilityKeyin interfaceOptionEnum
 
- 
getPropertyName
public String getPropertyName()
- Specified by:
 getPropertyNamein interfaceOptionEnum
 
- 
getOptionType
public Class<?> getOptionType()
- Specified by:
 getOptionTypein interfaceOptionEnum
 
- 
getDefaultValue
public Object getDefaultValue()
- Specified by:
 getDefaultValuein interfaceOptionEnum
 
- 
isDefaultValue
public boolean isDefaultValue(Object value)
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
public void applyPropertyTo(Map<String,Object> optionsMap)
- Specified by:
 applyPropertyToin interfaceOptionEnum
 
- 
encode
public Object encode(Object value)
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
public Object decode(Object value)
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
public void insert(WebClientOptions options, Object value)
Insert the specified value for this option into the provided web client options object.- Parameters:
 options-WebClientOptionsobjectvalue- value to be inserted
 
- 
obtain
public Object obtain(WebClientOptions options)
Obtain the value for this option from the specified web client options object.- Parameters:
 options-WebClientOptionsobject- Returns:
 - value for this option
 
 
- 
fromCapabilityKey
public static HtmlUnitOption fromCapabilityKey(String key)
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
public static HtmlUnitOption fromPropertyName(String name)
Get the enumerated constant for the specified system property name.- Parameters:
 name- system property name- Returns:
 HtmlUnitOptionconstant for property name;nullif constant not found
 
 - 
 
 -