/** * <p>Return the body element for the most recently retrieved page. * If there is no such element, return <code>null</code>.</p> * * @exception Exception if an error occurs */ protected HtmlBody body() throws Exception { Iterator elements = page.getAllHtmlChildElements(); while (elements.hasNext()) { HtmlElement element = (HtmlElement) elements.next(); if (element instanceof HtmlBody) { return ((HtmlBody) element); } } return (null); }
/** * <p>Return the head element for the most recently retrieved page. * If there is no such element, return <code>null</code>.</p> * * @exception Exception if an error occurs */ protected HtmlHead head() throws Exception { Iterator elements = page.getAllHtmlChildElements(); while (elements.hasNext()) { HtmlElement element = (HtmlElement) elements.next(); if (element instanceof HtmlHead) { return ((HtmlHead) element); } } return (null); }
/** * <p>Return the body element for the most recently retrieved page. * If there is no such element, return <code>null</code>.</p> * * @exception Exception if an error occurs */ protected HtmlBody body() throws Exception { Iterator elements = page.getAllHtmlChildElements(); while (elements.hasNext()) { HtmlElement element = (HtmlElement) elements.next(); if (element instanceof HtmlBody) { return ((HtmlBody) element); } } return (null); }
/** * <p>Return the body element for the most recently retrieved page. * If there is no such element, return <code>null</code>.</p> * * @exception Exception if an error occurs */ protected HtmlBody body() throws Exception { Iterator elements = page.getAllHtmlChildElements(); while (elements.hasNext()) { HtmlElement element = (HtmlElement) elements.next(); if (element instanceof HtmlBody) { return ((HtmlBody) element); } } return (null); }
/** * <p>Return the head element for the most recently retrieved page. * If there is no such element, return <code>null</code>.</p> * * @exception Exception if an error occurs */ protected HtmlHead head() throws Exception { Iterator elements = page.getAllHtmlChildElements(); while (elements.hasNext()) { HtmlElement element = (HtmlElement) elements.next(); if (element instanceof HtmlHead) { return ((HtmlHead) element); } } return (null); }
/** * <p>Return the body element for the most recently retrieved page. * If there is no such element, return <code>null</code>.</p> * * @exception Exception if an error occurs */ protected HtmlBody body() throws Exception { Iterator elements = page.getAllHtmlChildElements(); while (elements.hasNext()) { HtmlElement element = (HtmlElement) elements.next(); if (element instanceof HtmlBody) { return ((HtmlBody) element); } } return (null); }
/** * <p>Return the head element for the most recently retrieved page. * If there is no such element, return <code>null</code>.</p> * * @exception Exception if an error occurs */ protected HtmlHead head() throws Exception { Iterator elements = page.getAllHtmlChildElements(); while (elements.hasNext()) { HtmlElement element = (HtmlElement) elements.next(); if (element instanceof HtmlHead) { return ((HtmlHead) element); } } return (null); }
/** * <p>Return the head element for the most recently retrieved page. * If there is no such element, return <code>null</code>.</p> * * @exception Exception if an error occurs */ protected HtmlHead head() throws Exception { Iterator elements = page.getAllHtmlChildElements(); while (elements.hasNext()) { HtmlElement element = (HtmlElement) elements.next(); if (element instanceof HtmlHead) { return ((HtmlHead) element); } } return (null); }
/** * <p>Return the body element for the most recently retrieved page. * If there is no such element, return <code>null</code>.</p> * * @exception Exception if an error occurs */ protected HtmlBody body() throws Exception { Iterator elements = page.getAllHtmlChildElements(); while (elements.hasNext()) { HtmlElement element = (HtmlElement) elements.next(); if (element instanceof HtmlBody) { return ((HtmlBody) element); } } return (null); }
/** * Verifies that all element IDs in the specified page are unique. * * @param page the page to check */ public static void assertAllIdAttributesUnique(final HtmlPage page) { final List<String> list = new ArrayList<String>(); for (final HtmlElement element : page.getAllHtmlChildElements()) { final String id = element.getAttribute("id"); if (id != null && id.length() != 0) { if (list.contains(id)) { throw new AssertionError("The element ID '" + id + "' is not unique."); } list.add(id); } } }
/** * Verifies that all element IDs in the specified page are unique. * * @param page the page to check */ public static void assertAllIdAttributesUnique(final HtmlPage page) { final List<String> list = new ArrayList<String>(); for (final HtmlElement element : page.getAllHtmlChildElements()) { final String id = element.getAttribute("id"); if (id != null && id.length() != 0) { if (list.contains(id)) { throw new AssertionError("The element ID '" + id + "' is not unique."); } list.add(id); } } }
/** * Many HTML components can have an <tt>accesskey</tt> attribute which defines a hot key for * keyboard navigation. This method verifies that all the <tt>accesskey</tt> attributes on the * specified page are unique. * * @param page the page to check */ public static void assertAllAccessKeyAttributesUnique(final HtmlPage page) { final List<String> list = new ArrayList<String>(); for (final HtmlElement element : page.getAllHtmlChildElements()) { final String key = element.getAttribute("accesskey"); if (key != null && key.length() != 0) { if (list.contains(key)) { throw new AssertionError("The access key '" + key + "' is not unique."); } list.add(key); } } }
/** * Many HTML components can have an <tt>accesskey</tt> attribute which defines a hot key for * keyboard navigation. This method verifies that all the <tt>accesskey</tt> attributes on the * specified page are unique. * * @param page the page to check */ public static void assertAllAccessKeyAttributesUnique(final HtmlPage page) { final List<String> list = new ArrayList<String>(); for (final HtmlElement element : page.getAllHtmlChildElements()) { final String key = element.getAttribute("accesskey"); if (key != null && key.length() != 0) { if (list.contains(key)) { throw new AssertionError("The access key '" + key + "' is not unique."); } list.add(key); } } }
/** * Verifies that all element IDs in the specified page are unique. * * @param page the page to check */ public static void assertAllIdAttributesUnique(final HtmlPage page) { final List<String> list = new ArrayList<String>(); for (final HtmlElement element : page.getAllHtmlChildElements()) { final String id = element.getAttribute("id"); if (id != null && id.length() != 0) { if (list.contains(id)) { throw new AssertionError("The element ID '" + id + "' is not unique."); } list.add(id); } } }
/** * Many HTML components can have an <tt>accesskey</tt> attribute which defines a hot key for * keyboard navigation. This method verifies that all the <tt>accesskey</tt> attributes on the * specified page are unique. * * @param page the page to check */ public static void assertAllAccessKeyAttributesUnique(final HtmlPage page) { final List<String> list = new ArrayList<String>(); for (final HtmlElement element : page.getAllHtmlChildElements()) { final String key = element.getAttribute("accesskey"); if (key != null && key.length() != 0) { if (list.contains(key)) { throw new AssertionError("The access key '" + key + "' is not unique."); } list.add(key); } } }
HtmlElement element4 = null; Iterable<HtmlElement> iterable5 = page.getAllHtmlChildElements(); Iterator<HtmlElement> i6 = iterable5.iterator(); while(i6.hasNext() { HtmlElement anElement = i6.next(); if(anElement instanceof HtmlImage) { HtmlImage input = (HtmlImage) anElement; String[] elements = "http://example.com/pages/powerbutton.png".split( "/" ); if(input.getSrcAttribute().indexOf(elements[elements.length-1] )> -1 ){ element4 = input; break; } } } HtmlPage page = element4.click();
HtmlElement element4 = null; Iterable<HtmlElement> iterable5 = page.getAllHtmlChildElements(); Iterator<HtmlElement> i6 = iterable5.iterator(); while(i6.hasNext()) { HtmlElement anElement = i6.next(); if(anElement instanceof HtmlImage) { HtmlImage input = (HtmlImage) anElement; String[] elements = "http://example.com/pages/powerbutton.png".split( "/" ); if(input.getSrcAttribute().indexOf(elements[elements.length-1] )> -1 ) { element4 = input; break; } } } HtmlPage page = element4.click();
/** * {@inheritDoc} * Override cloneNode to add cloned elements to the clone, not to the original. */ @Override public HtmlPage cloneNode(final boolean deep) { final HtmlPage result = (HtmlPage) super.cloneNode(deep); result.setScriptObject(getScriptObject()); if (deep) { // fix up idMap_ and result's idMap_s for (final HtmlElement child : result.getAllHtmlChildElements()) { removeMappedElement(child); result.addMappedElement(child); } } return result; }
/** * {@inheritDoc} * Override cloneNode to add cloned elements to the clone, not to the original. */ @Override public HtmlPage cloneNode(final boolean deep) { final HtmlPage result = (HtmlPage) super.cloneNode(deep); result.setScriptObject(getScriptObject()); if (deep) { // fix up idMap_ and result's idMap_s for (final HtmlElement child : result.getAllHtmlChildElements()) { removeMappedElement(child); result.addMappedElement(child); } } return result; }
/** * {@inheritDoc} * Override cloneNode to add cloned elements to the clone, not to the original. */ @Override public HtmlPage cloneNode(final boolean deep) { final HtmlPage result = (HtmlPage) super.cloneNode(deep); result.setScriptObject(getScriptObject()); if (deep) { // fix up idMap_ and result's idMap_s for (final HtmlElement child : result.getAllHtmlChildElements()) { removeMappedElement(child); result.addMappedElement(child); } } return result; }