Package org.htmlunit
Class WebClientUtil
java.lang.Object
org.htmlunit.WebClientUtil
WebClient
helper methods.- Author:
- tom.fennelly@gmail.com
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
JavaScript Exception listener. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddExceptionListener
(org.htmlunit.WebClient webClient) Create and add anWebClientUtil.ExceptionListener
to theWebClient
instance.static void
waitForJSExec
(org.htmlunit.WebClient webClient) Wait for all async JavaScript tasks associated with the suppliedWebClient
instance to complete.static void
waitForJSExec
(org.htmlunit.WebClient webClient, long timeout) Wait for all async JavaScript tasks associated with the suppliedWebClient
instance to complete.
-
Constructor Details
-
WebClientUtil
public WebClientUtil()
-
-
Method Details
-
waitForJSExec
public static void waitForJSExec(org.htmlunit.WebClient webClient) Wait for all async JavaScript tasks associated with the suppliedWebClient
instance to complete.Waits for 10 seconds before timing out.
- Parameters:
webClient
- TheWebClient
instance.
-
waitForJSExec
public static void waitForJSExec(org.htmlunit.WebClient webClient, long timeout) Wait for all async JavaScript tasks associated with the suppliedWebClient
instance to complete.- Parameters:
webClient
- TheWebClient
instance.timeout
- The timeout in milliseconds.
-
addExceptionListener
public static WebClientUtil.ExceptionListener addExceptionListener(org.htmlunit.WebClient webClient) Create and add anWebClientUtil.ExceptionListener
to theWebClient
instance.- Parameters:
webClient
- TheWebClient
instance.- Returns:
- The
WebClientUtil.ExceptionListener
.
-