com.meterware.httpunit
public abstract class HttpUnitOptions extends Object
Field Summary | |
---|---|
static String | DEFAULT_SCRIPT_ENGINE_FACTORY |
Method Summary | |
---|---|
static void | addHtmlErrorListener(HTMLParserListener el)
Add an Html error listener. |
static void | clearScriptErrorMessages()
Clears the accumulated script error messages. |
static boolean | getAutoRedirect()
Returns true if HttpUnit should automatically follow page redirect requests (status 3xx).
|
static boolean | getAutoRefresh()
Returns true if HttpUnit should automatically follow page refresh requests.
|
static String | getDefaultCharacterSet()
Returns the character set to be used for pages which do not specify one.
|
static String | getDefaultContentType()
Returns the content type to be used for pages which do not specify one.
|
static boolean | getExceptionsThrownOnErrorStatus()
Returns true if WebClient.getResponse throws exceptions when detected an error status.
|
static boolean | getExceptionsThrownOnScriptError()
Returns true if script errors cause exceptions to be thrown. |
static Vector | getHtmlErrorListeners()
Get the list of Html Error Listeners |
static boolean | getImagesTreatedAsAltText()
Returns true if images are treated as text, using their alt attributes.
|
static boolean | getMatchesIgnoreCase()
If true, text matches in methods such as {@link HTMLSegment#getLinkWith} are
case insensitive. |
static boolean | getParameterValuesValidated()
Returns true if form parameter settings are checked.
|
static boolean | getParserWarningsEnabled()
Returns true if parser warnings are enabled. |
static int | getRedirectDelay()
Returns the delay, in milliseconds, before a redirect request is issues.
|
static String | getScriptEngineClassName() |
static String[] | getScriptErrorMessages()
Returns the accumulated script error messages encountered. |
static ScriptingEngineFactory | getScriptingEngine() |
static boolean | isAcceptCookies()
Returns true if HttpUnit is accepting and saving cookies. |
static boolean | isAcceptGzip()
Returns true if any WebClient created will accept GZIP encoding of responses. |
static boolean | isCheckContentLength()
Returns true if HttpUnit will throw an exception when a message is only partially received. |
static boolean | isLoggingHttpHeaders()
Returns true if HTTP headers are to be dumped to system output.
|
static boolean | isPostIncludesCharset()
Returns true if POST requests should include the character set in the content-type header.
|
static boolean | isScriptingEnabled() |
static void | removeHtmlErrorListener(HTMLParserListener el)
Remove an Html error listener. |
static void | reset()
Resets all options to their default values. |
static void | resetDefaultCharacterSet()
Resets the default character set to the HTTP default encoding.
|
static void | resetDefaultContentType()
Resets the default content type to plain text.
|
static void | setAcceptCookies(boolean acceptCookies)
Specifies whether HttpUnit should accept and send cookies. |
static void | setAcceptGzip(boolean acceptGzip)
Specifies whether a WebClient will be initialized to accept GZIP encoded responses. |
static void | setAutoRedirect(boolean autoRedirect)
Determines whether HttpUnit should automatically follow page redirect requests (status 3xx).
|
static void | setAutoRefresh(boolean autoRefresh)
Specifies whether HttpUnit should automatically follow page refresh requests.
|
static void | setCheckContentLength(boolean checkContentLength)
Specifies whether HttpUnit should throw an exception when the content length of a message does not match its
actual received length. |
static void | setDefaultCharacterSet(String characterSet)
Sets the default character set for pages which do not specify one and for requests created without HTML sources.
|
static void | setDefaultContentType(String contentType)
Sets the default content type for pages which do not specify one.
|
static void | setExceptionsThrownOnErrorStatus(boolean enabled)
If true, WebClient.getResponse throws an exception when it receives an error status.
|
static void | setExceptionsThrownOnScriptError(boolean throwExceptions)
Determines whether script errors result in exceptions or warning messages. |
static void | setImagesTreatedAsAltText(boolean asText)
If true, tells HttpUnit to treat images with alt attributes as though they were the text
value of that attribute in all searches and displays. |
static void | setLoggingHttpHeaders(boolean enabled)
If true, tells HttpUnit to log HTTP headers to system output. |
static void | setMatchesIgnoreCase(boolean ignoreCase)
If true, text matches in methods such as {@link HTMLSegment#getLinkWith} are
case insensitive. |
static void | setParameterValuesValidated(boolean validated)
If true, tells HttpUnit to throw an exception on any attempt to set a form parameter to a value
which could not be set via the browser. |
static void | setParserWarningsEnabled(boolean enabled)
If true, tells the parser to display warning messages. |
static void | setPostIncludesCharset(boolean postIncludesCharset)
Determines whether a normal POST request will include the character set in the content-type header.
|
static void | setRedirectDelay(int delayInMilliseconds)
Sets the delay, in milliseconds, before a redirect request is issued. |
static void | setScriptEngineClassName(String scriptEngineClassName) |
static void | setScriptingEnabled(boolean scriptingEnabled) |
Deprecated: as of 1.5.2, use HTMLParserfactory#addHTMLParserListener
Add an Html error listener.Deprecated: as of 1.5.3, use ClientProperties#isAutoRedirect();
Returns true if HttpUnit should automatically follow page redirect requests (status 3xx). By default, this is true.Deprecated: as of 1.5.3, use ClientProperties#isAutoRefresh();
Returns true if HttpUnit should automatically follow page refresh requests. By default, this is false, so that programs can verify the redirect page presented to users before the browser switches to the new page.Deprecated: as of 1.5.2, removed with no replacement
Get the list of Html Error ListenersDeprecated: as of 1.6, use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation.
Returns true if form parameter settings are checked.Deprecated: as of 1.5.2, use HTMLParserFactory#isParserWarningsEnabled
Returns true if parser warnings are enabled.Deprecated: as of 1.5.3, use ClientProperties#isAcceptCookies();
Returns true if HttpUnit is accepting and saving cookies. The default is to accept them.Deprecated: as of 1.5.3, use ClientProperties#isAcceptGzip();
Returns true if any WebClient created will accept GZIP encoding of responses. The default is to accept GZIP encoding.Deprecated: as of 1.5.2, use HTMLParserfactory#removeHTMLParserListener
Remove an Html error listener.Deprecated: as of 1.5.3, use ClientProperties#setAcceptCookies();
Specifies whether HttpUnit should accept and send cookies.Deprecated: as of 1.5.3, use ClientProperties#setAcceptGzip();
Specifies whether a WebClient will be initialized to accept GZIP encoded responses. The default is true.Deprecated: as of 1.5.3, use ClientProperties#setAutoRedirect();
Determines whether HttpUnit should automatically follow page redirect requests (status 3xx). By default, this is true in order to simulate normal browser operation.Deprecated: as of 1.5.3, use ClientProperties#setAutoRefresh();
Specifies whether HttpUnit should automatically follow page refresh requests. By default, this is false, so that programs can verify the redirect page presented to users before the browser switches to the new page. Setting this to true can cause an infinite loop on pages that refresh themselves.Deprecated: as of 1.6, use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation.
If true, tells HttpUnit to throw an exception on any attempt to set a form parameter to a value which could not be set via the browser. The default is true (parameters are validated).Deprecated: as of 1.5.2, use HTMLParserFactory#setParserWarningsEnabled
If true, tells the parser to display warning messages. The default is false (warnings are not shown).