/** * Open a new window with the specified name. If the URL is non-null then attempt to load * a page from that location and put it in the new window. * * @param url the URL to load content from or null if no content is to be loaded * @param windowName the name of the new window * @return the new window */ public WebWindow openWindow(final URL url, final String windowName) { WebAssert.notNull("windowName", windowName); return openWindow(url, windowName, getCurrentWindow()); }
/** * Open a new window with the specified name. If the URL is non-null then attempt to load * a page from that location and put it in the new window. * * @param url the URL to load content from or null if no content is to be loaded * @param windowName the name of the new window * @return the new window */ public WebWindow openWindow(final URL url, final String windowName) { WebAssert.notNull("windowName", windowName); return openWindow(url, windowName, getCurrentWindow()); }
/** * Open a new window with the specified name. If the URL is non-null then attempt to load * a page from that location and put it in the new window. * * @param url the URL to load content from or null if no content is to be loaded * @param windowName the name of the new window * @return the new window */ public WebWindow openWindow(final URL url, final String windowName) { WebAssert.notNull("windowName", windowName); return openWindow(url, windowName, getCurrentWindow()); }
/** * Open a new window with the specified name. If the URL is non-null then attempt to load * a page from that location and put it in the new window. * * @param url the URL to load content from or null if no content is to be loaded * @param windowName the name of the new window * @return the new window */ public WebWindow openWindow(final URL url, final String windowName) { WebAssert.notNull("windowName", windowName); return openWindow(url, windowName, getCurrentWindow()); }
/** * Open a new window with the specified name. If the URL is non-null then attempt to load * a page from that location and put it in the new window. * * @param url the URL to load content from or null if no content is to be loaded * @param windowName the name of the new window * @return the new window */ public WebWindow openWindow(final URL url, final String windowName) { WebAssert.notNull("windowName", windowName); return openWindow(url, windowName, getCurrentWindow()); }
@Override public InputStream getInputStream(URL resourceUrl) throws TestingEngineResponseException { WebWindow imageWindow = null; try { // as far as I can tell, there is no such thing as an iframe/object kind of "window" in htmlunit, so I'm // opening a fake new window here imageWindow = wc.openWindow(resourceUrl, "for_stream"); Page page = imageWindow.getEnclosedPage(); return page.getWebResponse().getContentAsStream(); } catch (FailingHttpStatusCodeException aException) { throw new TestingEngineResponseException( aException.getStatusCode(), aException); } catch (IOException e) { throw new RuntimeException(e); } finally { if (imageWindow != null) { wc.deregisterWebWindow(imageWindow); } } }
final WebWindow newWebWindow = webClient.openWindow(newUrl, windowName, webWindow_); return newWebWindow.getScriptObject();
final WebWindow newWebWindow = webClient.openWindow(newUrl, windowName, webWindow_); return getProxy(newWebWindow);
@SuppressWarnings("deprecation") protected Scriptable getWindow() { final WebClient webClient = new WebClient(getBrowserVersion()); final WebWindow webWindow = webClient.openWindow(null, "main"); final Window window = (Window) webWindow.getScriptObject(); final WebResponse webResponse = new StringWebResponse(getPageString(), getPageURL()); HtmlPage page = null; try { page = HTMLParser.parseHtml(webResponse, webWindow); } catch (final IOException ioex) { throw new AssertionError(ioex); } window.setDomNode(page); return window; //return window; }
/** * Open this link in a new window, much as web browsers do when you shift-click a link or use the context * menu to open in a new window. * * It should be noted that even web browsers will sometimes not give the expected result when using this * method of following links. Links that have no real href and rely on JavaScript to do their work will * fail. * * @return the page opened by this link, nested in a new {@link com.gargoylesoftware.htmlunit.TopLevelWindow} * @throws MalformedURLException if the href could not be converted to a valid URL */ public final Page openLinkInNewWindow() throws MalformedURLException { final URL target = ((HtmlPage) getPage()).getFullyQualifiedUrl(getHrefAttribute()); final String windowName = "HtmlAnchor.openLinkInNewWindow() target"; final WebWindow newWindow = getPage().getWebClient().openWindow(target, windowName); return newWindow.getEnclosedPage(); } }
/** * Open this link in a new window, much as web browsers do when you shift-click a link or use the context * menu to open in a new window. * * It should be noted that even web browsers will sometimes not give the expected result when using this * method of following links. Links that have no real href and rely on JavaScript to do their work will * fail. * * @return the page opened by this link, nested in a new {@link com.gargoylesoftware.htmlunit.TopLevelWindow} * @throws MalformedURLException if the href could not be converted to a valid URL */ public final Page openLinkInNewWindow() throws MalformedURLException { final URL target = ((HtmlPage) getPage()).getFullyQualifiedUrl(getHrefAttribute()); final String windowName = "HtmlAnchor.openLinkInNewWindow() target"; final WebWindow newWindow = getPage().getWebClient().openWindow(target, windowName); return newWindow.getEnclosedPage(); } }
/** * Open this link in a new window, much as web browsers do when you shift-click a link or use the context * menu to open in a new window. * * It should be noted that even web browsers will sometimes not give the expected result when using this * method of following links. Links that have no real href and rely on JavaScript to do their work will * fail. * * @return the page opened by this link, nested in a new {@link com.gargoylesoftware.htmlunit.TopLevelWindow} * @throws MalformedURLException if the href could not be converted to a valid URL */ public final Page openLinkInNewWindow() throws MalformedURLException { final URL target = ((HtmlPage) getPage()).getFullyQualifiedUrl(getHrefAttribute()); final String windowName = "HtmlAnchor.openLinkInNewWindow() target"; final WebWindow newWindow = getPage().getWebClient().openWindow(target, windowName); return newWindow.getEnclosedPage(); }
/** * Open this link in a new window, much as web browsers do when you shift-click a link or use the context * menu to open in a new window. * * It should be noted that even web browsers will sometimes not give the expected result when using this * method of following links. Links that have no real href and rely on JavaScript to do their work will * fail. * * @return the page opened by this link, nested in a new {@link com.gargoylesoftware.htmlunit.TopLevelWindow} * @throws MalformedURLException if the href could not be converted to a valid URL */ public final Page openLinkInNewWindow() throws MalformedURLException { final URL target = ((HtmlPage) getPage()).getFullyQualifiedUrl(getHrefAttribute()); final String windowName = "HtmlAnchor.openLinkInNewWindow() target"; final WebWindow newWindow = getPage().getWebClient().openWindow(target, windowName); return newWindow.getEnclosedPage(); } }
/** * Open this link in a new window, much as web browsers do when you shift-click a link or use the context * menu to open in a new window. * * It should be noted that even web browsers will sometimes not give the expected result when using this * method of following links. Links that have no real href and rely on JavaScript to do their work will * fail. * * @return the page opened by this link, nested in a new {@link com.gargoylesoftware.htmlunit.TopLevelWindow} * @throws MalformedURLException if the href could not be converted to a valid URL */ public final Page openLinkInNewWindow() throws MalformedURLException { final URL target = ((HtmlPage) getPage()).getFullyQualifiedUrl(getHrefAttribute()); final String windowName = "HtmlAnchor.openLinkInNewWindow() target"; final WebWindow newWindow = getPage().getWebClient().openWindow(target, windowName); return newWindow.getEnclosedPage(); }
final WebWindow newWebWindow = webClient.openWindow(newUrl, windowName, webWindow_); return getProxy(newWebWindow);
final WebWindow w = openWindow(null, null, webWindow); final Page page = pageCreator_.createPage(webResponse, w); attachmentHandler_.handleAttachment(page);
final WebWindow w = openWindow(null, null, webWindow); final Page page = pageCreator_.createPage(webResponse, w); attachmentHandler_.handleAttachment(page);
final WebWindow w = openWindow(null, null, webWindow); final Page page = pageCreator_.createPage(webResponse, w); attachmentHandler_.handleAttachment(page);
final WebWindow w = openWindow(null, null, webWindow); final Page page = pageCreator_.createPage(webResponse, w); attachmentHandler_.handleAttachment(page);
final WebWindow w = openWindow(null, null, webWindow); final Page page = pageCreator_.createPage(webResponse, w); attachmentHandler_.handleAttachment(page);