/** * Modify the supplied {@link WebClient} and retain a reference to it so that its * {@link WebConnection} is {@linkplain #getWebConnection accessible} for later use. * <p>Delegates to {@link HtmlUnitDriver#modifyWebClient} for default behavior * and to {@link #modifyWebClientInternal} for further customization. * @param webClient the client to modify * @return the modified client * @see HtmlUnitDriver#modifyWebClient(WebClient) * @see #modifyWebClientInternal(WebClient) */ @Override protected final WebClient modifyWebClient(WebClient webClient) { this.webClient = super.modifyWebClient(webClient); this.webClient = modifyWebClientInternal(this.webClient); return this.webClient; }
/** * Modify the supplied {@link WebClient} and retain a reference to it so that its * {@link WebConnection} is {@linkplain #getWebConnection accessible} for later use. * <p>Delegates to {@link HtmlUnitDriver#modifyWebClient} for default behavior * and to {@link #modifyWebClientInternal} for further customization. * @param webClient the client to modify * @return the modified client * @see HtmlUnitDriver#modifyWebClient(WebClient) * @see #modifyWebClientInternal(WebClient) */ @Override protected final WebClient modifyWebClient(WebClient webClient) { this.webClient = super.modifyWebClient(webClient); this.webClient = modifyWebClientInternal(this.webClient); return this.webClient; }
/** * Modify the supplied {@link WebClient} and retain a reference to it so that its * {@link WebConnection} is {@linkplain #getWebConnection accessible} for later use. * <p>Delegates to {@link HtmlUnitDriver#modifyWebClient} for default behavior * and to {@link #modifyWebClientInternal} for further customization. * @param webClient the client to modify * @return the modified client * @see HtmlUnitDriver#modifyWebClient(WebClient) * @see #modifyWebClientInternal(WebClient) */ @Override protected final WebClient modifyWebClient(WebClient webClient) { this.webClient = super.modifyWebClient(webClient); this.webClient = modifyWebClientInternal(this.webClient); return this.webClient; }
@Override protected WebClient modifyWebClient(WebClient client) { WebClient modifiedClient = super.modifyWebClient(client); modifiedClient.getOptions().setThrowExceptionOnScriptError(false); modifiedClient.setCssErrorHandler(new SilentCssErrorHandler()); return modifiedClient; } }
@Override protected WebClient modifyWebClient(WebClient client) { WebClient modifiedClient = super.modifyWebClient(client); modifiedClient.getOptions().setThrowExceptionOnScriptError(false); modifiedClient.setCssErrorHandler(new SilentCssErrorHandler()); return modifiedClient; } }
private WebClient createWebClient(BrowserVersion version) { WebClient client = newWebClient(version); WebClientOptions options = client.getOptions(); options.setHomePage(WebClient.URL_ABOUT_BLANK.toString()); options.setThrowExceptionOnFailingStatusCode(false); options.setPrintContentOnFailingStatusCode(false); options.setJavaScriptEnabled(enableJavascript); options.setRedirectEnabled(true); options.setUseInsecureSSL(true); // Ensure that we've set the proxy if necessary if (proxyConfig != null) { options.setProxyConfig(proxyConfig); } client.setRefreshHandler(new WaitingRefreshHandler()); return modifyWebClient(client); }
private WebClient createWebClient(BrowserVersion version) { WebClient client = newWebClient(version); client.setThrowExceptionOnFailingStatusCode(false); client.setPrintContentOnFailingStatusCode(false); client.setJavaScriptEnabled(enableJavascript); client.setRedirectEnabled(true); try { client.setUseInsecureSSL(true); } catch (GeneralSecurityException e) { throw new WebDriverException(e); } // Ensure that we've set the proxy if necessary if (proxyConfig != null) client.setProxyConfig(proxyConfig); return modifyWebClient(client); }