com.meterware.httpunit
Class WebResponse

java.lang.Object
  |
  +--com.meterware.httpunit.WebResponse

public class WebResponse
extends java.lang.Object

A response from a web server to an Http request.


Method Summary
 org.w3c.dom.Document getDOM()
          Returns a copy of the domain object model tree associated with this response.
 WebForm[] getForms()
          Returns the forms found in the page in the order in which they appear.
 WebLink[] getLinks()
          Returns the links found in the page in the order in which they appear.
 WebLink getLinkWith(java.lang.String text)
          Returns the first link which contains the specified text.
 WebLink getLinkWithImageText(java.lang.String text)
          Returns the first link which contains an image with the specified text as its 'alt' attribute.
 WebTable[] getTables()
          Returns the top-level tables found in this page in the order in which they appear.
 WebTable getTableStartingWith(java.lang.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.
 WebTable getTableStartingWithPrefix(java.lang.String text)
          Returns the first table in the response which has the specified text as a prefix of the text of its first non-blank row and non-blank column.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getForms

public WebForm[] getForms()
                   throws org.xml.sax.SAXException
Returns the forms found in the page in the order in which they appear.
Throws:
org.xml.sax.SAXException - thrown if there is an error parsing the response.

getLinks

public WebLink[] getLinks()
                   throws org.xml.sax.SAXException
Returns the links found in the page in the order in which they appear.
Throws:
org.xml.sax.SAXException - thrown if there is an error parsing the response.

getLinkWith

public WebLink getLinkWith(java.lang.String text)
                    throws org.xml.sax.SAXException
Returns the first link which contains the specified text.

getLinkWithImageText

public WebLink getLinkWithImageText(java.lang.String text)
                             throws org.xml.sax.SAXException
Returns the first link which contains an image with the specified text as its 'alt' attribute.

getTables

public WebTable[] getTables()
                     throws org.xml.sax.SAXException
Returns the top-level tables found in this page in the order in which they appear.
Throws:
org.xml.sax.SAXException - thrown if there is an error parsing the response.

getDOM

public org.w3c.dom.Document getDOM()
                            throws org.xml.sax.SAXException
Returns a copy of the domain object model tree associated with this response.
Throws:
org.xml.sax.SAXException - thrown if there is an error parsing the response.

getTableStartingWith

public WebTable getTableStartingWith(java.lang.String text)
                              throws org.xml.sax.SAXException
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. Case is ignored.
Returns:
the selected table, or null if none is found
Throws:
org.xml.sax.SAXException - thrown if there is an error parsing the response.

getTableStartingWithPrefix

public WebTable getTableStartingWithPrefix(java.lang.String text)
                                    throws org.xml.sax.SAXException
Returns the first table in the response which has the specified text as a prefix of the text of its first non-blank row and non-blank column. Will recurse into any nested tables, as needed. Case is ignored.
Returns:
the selected table, or null if none is found
Throws:
org.xml.sax.SAXException - thrown if there is an error parsing the response.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object