public Page refreshPage() { try { currentPage = (HtmlPage) currentPage.refresh(); waitForAsyncEventsThatBeginWithinDefaultTime(); return currentPage; } catch (IOException e) { throw new RuntimeException(e); } }
HtmlPage page = webClient.getPage("https://www.yourwebsite.com/#"); HtmlAnchor link=page.getElementByName("link"); link.click(); page.refresh();
public void refresh() { if (lastPage() instanceof HtmlPage) { try { ((HtmlPage) lastPage()).refresh(); } catch (IOException e) { throw new WebDriverException(e); } } } }
@Override public void refresh() { if (lastPage() instanceof HtmlPage) { try { ((HtmlPage) lastPage()).refresh(); } catch (SocketTimeoutException e) { throw new TimeoutException(e); } catch (IOException e) { throw new WebDriverException(e); } } } }