Package com.meterware.httpunit
Class ParsedHTML
java.lang.Object
com.meterware.httpunit.ParsedHTML
- Direct Known Subclasses:
BlockElement
,HTMLPage
- Author:
- Russell Gold, Benoit Xhenseval
-
Method Summary
Modifier and TypeMethodDescriptionReturns a proxy for each applet found embedded in this page.getDOM()
Returns a copy of the domain object model associated with this page.String[]
Returns a list of HTML element names contained in this HTML section.getElementsWithAttribute
(String name, String value) Returns the HTML elements with an attribute with the specified name and value.getElementsWithName
(String name) Returns the HTML elements with the specified name.Returns the HTMLElement with the specified ID.getFirstMatchingForm
(HTMLElementPredicate predicate, Object criteria) Returns the first link found in the page matching the specified criteria.getFirstMatchingLink
(HTMLElementPredicate predicate, Object criteria) Returns the first link found in the page matching the specified criteria.getFirstMatchingTable
(HTMLElementPredicate predicate, Object criteria) Returns the first table in the response which matches the specified predicate and value.getFirstMatchingTextBlock
(HTMLElementPredicate predicate, Object criteria) Returns the first text block found in the page which matches the specified predicate and value.WebForm[]
getForms()
Returns the forms found in the page in the order in which they appear.getFormWithID
(String id) Returns the form found in the page with the specified ID.getFormWithName
(String name) Returns the form found in the page with the specified name.com.meterware.httpunit.WebFrame[]
Returns the frames found in the page in the order in which they appear.WebImage[]
Returns the images found in the page in the order in which they appear.getImageWithAltText
(String altText) Returns the first image found in the page with the specified alt attribute.getImageWithName
(String name) Returns the image found in the page with the specified name.getImageWithSource
(String source) Returns the first image found in the page with the specified src attribute.WebLink[]
getLinks()
Returns the links found in the page in the order in which they appear.getLinkWith
(String text) Returns the first link which contains the specified text.getLinkWithID
(String id) Returns the link found in the page with the specified ID.getLinkWithImageText
(String text) Returns the link which contains the first image with the specified text as its 'alt' attribute.getLinkWithName
(String name) Returns the link found in the page with the specified name.WebForm[]
getMatchingForms
(HTMLElementPredicate predicate, Object criteria) Returns all links found in the page matching the specified criteria.WebLink[]
getMatchingLinks
(HTMLElementPredicate predicate, Object criteria) Returns all links found in the page matching the specified criteria.WebTable[]
getMatchingTables
(HTMLElementPredicate predicate, Object criteria) Returns the tables in the response which match the specified predicate and value.getNextTextBlock
(TextBlock block) WebTable[]
Returns the top-level tables found in the page in the order in which they appear.getTableStartingWith
(String text) Returns the first table in the response which has the specified text as the full text of its first non-blank row and non-blank column.Returns the first table in the response which has the specified text as a prefix of the text in its first non-blank row and non-blank column.getTableWithID
(String ID) Returns the first table in the response which has the specified text as its ID attribute.getTableWithSummary
(String summary) Returns the first table in the response which has the specified text as its summary attribute.Returns the top-level block elements found in the page in the order in which they appear.static boolean
check whether the given node is a Web link by checking that the node is of type "A"toString()
-
Method Details
-
getForms
Returns the forms found in the page in the order in which they appear.- Returns:
- an array of objects representing the forms in the page or portion of a page.
-
getLinks
Returns the links found in the page in the order in which they appear. -
getApplets
Returns a proxy for each applet found embedded in this page. -
getImages
Returns the images found in the page in the order in which they appear. -
getTextBlocks
Returns the top-level block elements found in the page in the order in which they appear. -
getFirstMatchingTextBlock
Returns the first text block found in the page which matches the specified predicate and value. -
getNextTextBlock
-
getTables
Returns the top-level tables found in the page in the order in which they appear. -
getElementWithID
Returns the HTMLElement with the specified ID. -
getElementsWithName
Returns the HTML elements with the specified name. -
getElementsWithAttribute
Returns the HTML elements with an attribute with the specified name and value.- Parameters:
name
- - the name of the attribute to checkvalue
- - the value of the attribute to check
-
getElementNames
Returns a list of HTML element names contained in this HTML section. -
getFormWithID
Returns the form found in the page with the specified ID. -
getLinkWithID
Returns the link found in the page with the specified ID. -
getFirstMatchingForm
Returns the first link found in the page matching the specified criteria. -
getMatchingForms
Returns all links found in the page matching the specified criteria. -
getFormWithName
Returns the form found in the page with the specified name. -
isWebLink
check whether the given node is a Web link by checking that the node is of type "A"- Parameters:
node
- - the node to check- Returns:
- whether the given node represents a web link
-
getLinkWith
Returns the first link which contains the specified text. -
getLinkWithImageText
Returns the link which contains the first image with the specified text as its 'alt' attribute. -
getLinkWithName
Returns the link found in the page with the specified name. -
getFirstMatchingLink
Returns the first link found in the page matching the specified criteria. -
getMatchingLinks
Returns all links found in the page matching the specified criteria. -
getImageWithName
Returns the image found in the page with the specified name. -
getImageWithSource
Returns the first image found in the page with the specified src attribute. -
getImageWithAltText
Returns the first image found in the page with the specified alt attribute. -
getFirstMatchingTable
Returns the first table in the response which matches the specified predicate and value. Will recurse into any nested tables, as needed.- Returns:
- the selected table, or null if none is found
-
getMatchingTables
Returns the tables in the response which match the specified predicate and value. Will recurse into any nested tables, as needed.- Returns:
- the selected tables, or null if none are found
-
getTableStartingWith
Returns the first table in the response which has the specified text as the full text of its first non-blank row and non-blank column. Will recurse into any nested tables, as needed.- Returns:
- the selected table, or null if none is found
-
getTableStartingWithPrefix
Returns the first table in the response which has the specified text as a prefix of the text in its first non-blank row and non-blank column. Will recurse into any nested tables, as needed.- Returns:
- the selected table, or null if none is found
-
getTableWithSummary
Returns the first table in the response which has the specified text as its summary attribute. Will recurse into any nested tables, as needed.- Returns:
- the selected table, or null if none is found
-
getTableWithID
Returns the first table in the response which has the specified text as its ID attribute. Will recurse into any nested tables, as needed.- Returns:
- the selected table, or null if none is found
-
getDOM
Returns a copy of the domain object model associated with this page. -
toString
-
getFrames
public com.meterware.httpunit.WebFrame[] getFrames()Returns the frames found in the page in the order in which they appear.
-