Package org.htmlunit
Class WebClientUtil
- java.lang.Object
-
- org.htmlunit.WebClientUtil
-
public class WebClientUtil extends Object
WebClient
helper methods.- Author:
- tom.fennelly@gmail.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WebClientUtil.ExceptionListener
JavaScript Exception listener.
-
Constructor Summary
Constructors Constructor Description WebClientUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WebClientUtil.ExceptionListener
addExceptionListener(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.
-
-
-
Method Detail
-
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
.
-
-