/** * Returns the value of the window's <tt>name</tt> property. * @return the value of the window's <tt>name</tt> property */ public String jsxGet_name() { return webWindow_.getName(); }
/** * Returns the value of the window's <tt>name</tt> property. * @return the value of the window's <tt>name</tt> property */ public String jsxGet_name() { return webWindow_.getName(); }
/** * Returns the value of the window's <tt>name</tt> property. * @return the value of the window's <tt>name</tt> property */ public String jsxGet_name() { return webWindow_.getName(); }
@Override protected void addElementIds(final List<String> idList, final List<DomNode> elements) { for (final DomNode next : elements) { final BaseFrameElement frameElt = (BaseFrameElement) next; final WebWindow window = frameElt.getEnclosedWindow(); final String windowName = window.getName(); if (windowName != null) { idList.add(windowName); } } } }
@Override protected void addElementIds(final List<String> idList, final List<DomNode> elements) { for (final DomNode next : elements) { final BaseFrameElement frameElt = (BaseFrameElement) next; final WebWindow window = frameElt.getEnclosedWindow(); final String windowName = window.getName(); if (windowName != null) { idList.add(windowName); } } } }
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 window's {@code name} property. * @return the value of the window's {@code name} property */ @JsxGetter public String getName() { return getWebWindow().getName(); }
@Override public void webWindowOpened(WebWindowEvent event) { String win = event.getWebWindow().getName(); Page newPage = event.getNewPage(); if (newPage instanceof HtmlPage) { logger.debug("Window {} opened : {}", win, ((HtmlPage) newPage).getTitleText()); } else { logger.info("Window {} opened", win); } } });
/** * Returns the value of the window's {@code name} property. * @return the value of the window's {@code name} property */ @JsxGetter public String getName() { return getWebWindow().getName(); }
/** * Returns the first {@link WebWindow} that matches the specified name. * * @param name the name to search for * @return the {@link WebWindow} with the specified name * @throws WebWindowNotFoundException if the {@link WebWindow} can't be found * @see #getWebWindows() * @see #getTopLevelWindows() */ public WebWindow getWebWindowByName(final String name) throws WebWindowNotFoundException { WebAssert.notNull("name", name); for (final WebWindow webWindow : windows_) { if (name.equals(webWindow.getName())) { return webWindow; } } throw new WebWindowNotFoundException(name); }
/** * Returns the first {@link WebWindow} that matches the specified name. * * @param name the name to search for * @return the {@link WebWindow} with the specified name * @throws WebWindowNotFoundException if the {@link WebWindow} can't be found * @see #getWebWindows() * @see #getTopLevelWindows() */ public WebWindow getWebWindowByName(final String name) throws WebWindowNotFoundException { WebAssert.notNull("name", name); for (final WebWindow webWindow : windows_) { if (name.equals(webWindow.getName())) { return webWindow; } } throw new WebWindowNotFoundException(name); }
/** * Returns the first {@link WebWindow} that matches the specified name. * * @param name the name to search for * @return the {@link WebWindow} with the specified name * @throws WebWindowNotFoundException if the {@link WebWindow} can't be found * @see #getWebWindows() * @see #getTopLevelWindows() */ public WebWindow getWebWindowByName(final String name) throws WebWindowNotFoundException { WebAssert.notNull("name", name); for (final WebWindow webWindow : windows_) { if (webWindow.getName().equals(name)) { return webWindow; } } throw new WebWindowNotFoundException(name); }
/** * Returns the first {@link WebWindow} that matches the specified name. * * @param name the name to search for * @return the {@link WebWindow} with the specified name * @throws WebWindowNotFoundException if the {@link WebWindow} can't be found * @see #getWebWindows() * @see #getTopLevelWindows() */ public WebWindow getWebWindowByName(final String name) throws WebWindowNotFoundException { WebAssert.notNull("name", name); for (final WebWindow webWindow : windows_) { if (webWindow.getName().equals(name)) { return webWindow; } } throw new WebWindowNotFoundException(name); }
/** * Returns the first {@link WebWindow} that matches the specified name. * * @param name the name to search for * @return the {@link WebWindow} with the specified name * @throws WebWindowNotFoundException if the {@link WebWindow} can't be found * @see #getWebWindows() * @see #getTopLevelWindows() */ public WebWindow getWebWindowByName(final String name) throws WebWindowNotFoundException { WebAssert.notNull("name", name); for (final WebWindow webWindow : windows_) { if (webWindow.getName().equals(name)) { return webWindow; } } throw new WebWindowNotFoundException(name); }
@Override protected Object getWithPreemption(final String name) { final List<DomNode> elements = getElements(); for (final Object next : elements) { final BaseFrameElement frameElt = (BaseFrameElement) next; final WebWindow window = frameElt.getEnclosedWindow(); if (name.equals(window.getName())) { if (LOG.isDebugEnabled()) { LOG.debug("Property \"" + name + "\" evaluated (by name) to " + window); } return getScriptableForElement(window); } if (getBrowserVersion().hasFeature(JS_WINDOW_FRAMES_ACCESSIBLE_BY_ID) && frameElt.getId().equals(name)) { if (LOG.isDebugEnabled()) { LOG.debug("Property \"" + name + "\" evaluated (by id) to " + window); } return getScriptableForElement(window); } } return NOT_FOUND; }
@Override protected Object getWithPreemption(final String name) { final List<DomNode> elements = getElements(); for (final Object next : elements) { final BaseFrameElement frameElt = (BaseFrameElement) next; final WebWindow window = frameElt.getEnclosedWindow(); if (name.equals(window.getName())) { if (LOG.isDebugEnabled()) { LOG.debug("Property \"" + name + "\" evaluated (by name) to " + window); } return getScriptableForElement(window); } if (getBrowserVersion().hasFeature(JS_WINDOW_FRAMES_ACCESSIBLE_BY_ID) && frameElt.getId().equals(name)) { if (LOG.isDebugEnabled()) { LOG.debug("Property \"" + name + "\" evaluated (by id) to " + window); } return getScriptableForElement(window); } } return NOT_FOUND; }
@Override public void webWindowClosed(WebWindowEvent event) { if (win == null || event.getOldPage().equals(win.getEnclosedPage())) { win = wc.getCurrentWindow(); form = null; } String win = event.getWebWindow().getName(); Page oldPage = event.getOldPage(); String oldPageTitle = "no_html"; if (oldPage instanceof HtmlPage) { oldPageTitle = ((HtmlPage) oldPage).getTitleText(); } logger.debug("Window {} closed : {}", win, oldPageTitle); }
@Override public void webWindowContentChanged(WebWindowEvent event) { form = null; String winName = event.getWebWindow().getName(); Page oldPage = event.getOldPage(); Page newPage = event.getNewPage(); String oldPageTitle = "no_html"; if (oldPage instanceof HtmlPage) { oldPageTitle = ((HtmlPage) oldPage).getTitleText(); } String newPageTitle = "no_html"; if (newPage instanceof HtmlPage) { newPageTitle = ((HtmlPage) newPage).getTitleText(); } logger.debug("Window \"{}\" changed : \"{}\" became \"{}", new Object[] {winName, oldPageTitle, newPageTitle}); }
final String href = getHrefAttribute() + hrefSuffix; if (LOG.isDebugEnabled()) { final String w = defaultPage.getEnclosingWindow().getName(); LOG.debug("do click action in window '" + w + "', using href '" + href + "'");