@Override public void run() { try { new WaitingRefreshHandler().handleRefresh(page, url, seconds); } catch (final IOException e) { LOG.error("Unable to refresh page!", e); throw new RuntimeException("Unable to refresh page!", e); } } };
CompositeUiTester(ApplicationProperties applicationProperties, Function<Login, HtmlPage> login, Function<WebSudoLogin, HtmlPage> webSudoLogin, Function<UiTester, Void> logout, Function<UiTester, String> getLoggedInUser, Function<UiTester, Boolean> isOnLogInPage, Function<Backup, Void> restore) { this.applicationProperties = applicationProperties; this.webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_11); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.setRefreshHandler(new WaitingRefreshHandler()); webClient.setAlertHandler(new AlertHandler() { public void handleAlert(Page page, String message) { System.out.println("ALERT: " + message); } }); this.login = login; this.webSudoLogin = webSudoLogin; this.logout = logout; this.getLoggedInUser = getLoggedInUser; this.isOnLogInPage = isOnLogInPage; this.restore = restore; }
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); }
@Override public void run() { try { new WaitingRefreshHandler().handleRefresh(page, url, seconds); } catch (final IOException e) { LOG.error("Unable to refresh page!", e); throw new RuntimeException("Unable to refresh page!", e); } } };
@Override public void run() { try { new WaitingRefreshHandler().handleRefresh(page, url, seconds); } catch (final IOException e) { LOG.error("Unable to refresh page!", e); throw new RuntimeException("Unable to refresh page!", e); } } };
@Override public void run() { try { new WaitingRefreshHandler().handleRefresh(page, url, seconds); } catch (final IOException e) { LOG.error("Unable to refresh page!", e); throw new RuntimeException("Unable to refresh page!", e); } } };
@Override public void run() { try { new WaitingRefreshHandler().handleRefresh(page, url, seconds); } catch (final IOException e) { LOG.error("Unable to refresh page!", e); throw new RuntimeException("Unable to refresh page!", e); } } };