/** * {@inheritDoc} */ @Override public void gotoRootWindow() { win = win.getTopWindow(); }
/** * Returns the value of the top property. * @return the value of "top" */ public SimpleScriptable jsxGet_top() { final WebWindow topWebWindow = webWindow_.getTopWindow(); return (SimpleScriptable) topWebWindow.getScriptObject(); }
public HtmlUnitDriverIterator() { List<WebWindow> allWindows = new ArrayList<WebWindow>(); for (WebWindow window : webClient.getWebWindows()) { WebWindow top = window.getTopWindow(); if (!allWindows.contains(top)) allWindows.add(top); } underlyingIterator = allWindows.iterator(); }
/** * Returns the value of the top property. * @return the value of "top" */ public SimpleScriptable jsxGet_top() { final WebWindow topWebWindow = webWindow_.getTopWindow(); return (SimpleScriptable) topWebWindow.getScriptObject(); }
/** * {@inheritDoc} */ @Override public WebWindow getTopWindow() { return getParentWindow().getTopWindow(); }
@Override public WebDriver defaultContent() { switchToDefaultContentOfWindow(getCurrentWindow().getTopWindow()); return HtmlUnitDriver.this; }
/** * {@inheritDoc} */ @Override public WebWindow getTopWindow() { return getParentWindow().getTopWindow(); }
/** * {@inheritDoc} */ public WebWindow getTopWindow() { return getParentWindow().getTopWindow(); }
/** * {@inheritDoc} */ public WebWindow getTopWindow() { return getParentWindow().getTopWindow(); }
/** * {@inheritDoc} */ public WebWindow getTopWindow() { return getParentWindow().getTopWindow(); }
/** * Returns the value of the top property. * @return the value of "top" */ public SimpleScriptable jsxGet_top() { final WebWindow topWebWindow = webWindow_.getTopWindow(); return (SimpleScriptable) topWebWindow.getScriptObject(); }
/** * Close the current window. */ @Override public void closeWindow() { if (win != null) { ((TopLevelWindow) win.getTopWindow()).close(); win = wc.getCurrentWindow(); form = null; } }
@Override public String getWindowHandle() { WebWindow topWindow = getCurrentWindow().getTopWindow(); if (topWindow.isClosed()) { throw new NoSuchWindowException("Window is closed"); } return String.valueOf(System.identityHashCode(topWindow)); }
/** * Returns the value of the {@code top} property. * @return the value of {@code top} */ @JsxGetter public Object getTop() { if (top_ != NOT_FOUND) { return top_; } final WebWindow top = getWebWindow().getTopWindow(); return top.getScriptableObject(); }
public Set<String> getWindowHandles() { Set<String> allHandles = new HashSet<String>(); List<WebWindow> allWindows = webClient.getWebWindows(); for (WebWindow window : allWindows) { WebWindow top = window.getTopWindow(); if (top.getName() == null || "".equals(top.getName())) { nameWindow(top); } allHandles.add(top.getName()); } return allHandles; }
/** * Returns the value of the {@code top} property. * @return the value of {@code top} */ @JsxGetter public Object getTop() { if (top_ != NOT_FOUND) { return top_; } final WebWindow top = getWebWindow().getTopWindow(); return top.getScriptableObject(); }
/** * Convenient method to load a URL into the current top WebWindow as it would be done * by {@link #getPage(WebWindow, WebRequestSettings)}. * @param url the URL of the new content * @param <P> the page type * @return the new page * @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property * {@link #setThrowExceptionOnFailingStatusCode(boolean)} is set to true. * @throws IOException if an IO problem occurs */ @SuppressWarnings("unchecked") public <P extends Page> P getPage(final URL url) throws IOException, FailingHttpStatusCodeException { return (P) getPage(getCurrentWindow().getTopWindow(), new WebRequestSettings(url)); }
/** * Convenient method to load a URL into the current top WebWindow as it would be done * by {@link #getPage(WebWindow, WebRequestSettings)}. * @param url the URL of the new content * @param <P> the page type * @return the new page * @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property * {@link #setThrowExceptionOnFailingStatusCode(boolean)} is set to true. * @throws IOException if an IO problem occurs */ @SuppressWarnings("unchecked") public <P extends Page> P getPage(final URL url) throws IOException, FailingHttpStatusCodeException { return (P) getPage(getCurrentWindow().getTopWindow(), new WebRequestSettings(url)); }
@Override public Dimension getSize() { WebWindow topWindow = getCurrentWindow().getTopWindow(); return new Dimension(topWindow.getOuterWidth(), topWindow.getOuterHeight()); }
@Override public void setSize(Dimension targetSize) { WebWindow topWindow = getCurrentWindow().getTopWindow(); int width = targetSize.getWidth(); if (width < SCROLLBAR_WIDTH) width = SCROLLBAR_WIDTH; topWindow.setOuterWidth(width); topWindow.setInnerWidth(width - SCROLLBAR_WIDTH); int height = targetSize.getHeight(); if (height < HEADER_HEIGHT) height = HEADER_HEIGHT; topWindow.setOuterHeight(height); topWindow.setInnerHeight(height - HEADER_HEIGHT); }