Fetch a file, an XML or a HTML page from a server or the file system. Any valid url can be used
http://server/file.html http://server/file.xml ftp://server/file.html file:\\server\file.htmlhttps will also work provided that java is configured correctly. See the httpUnit FAQ for more details.
The url used for a fetch can be supplied from
<fetch url="http://server/file.html"/> <verify>...</verify> <fetch page="topFrameset"/> <verify/> <!-- page="topFrameset" is implied --> <fetch link="newLink"/> <with page="topFrameset"> <fetch/> <verify/> </with> <fetch page="theNavArea" querystring="id=5&flag=true"/> <definePage name="topFrameset" url="..."> <frameset> <frame name="theNavArea" url="..."/> <frame name="globalArea" url="..."/> </frameset> </definePage> <definePage name="theNavArea" url="..."> <frame name="newLink" href="..."/> </definePage>
The result of the fetch can them be validated. See the verify element. It the validation fails unexpectedly, its possible that there is a problem with parsing the HTML. Set the htmlWarnings attribute to true, and retest. If the HTML is non-standard, parsing errors will be send to the stderr output stream.
Fetch can also be used to to verify the links on a site
<fetch url="http://..."/> <verifylinks depth="2" onsiteonly="true"/>See verifylinks.
EMPTY
Attribute Value(s) Default Value htmlwarnings true | false false link IDREF #IMPLIED page IDREF #IMPLIED querystring CDATA #IMPLIED stepid CDATA #IMPLIED url CDATA #IMPLIED useparentfordefault CDATA #FIXED = page
Empty
steps -- This element contains all the test steps.
suite -- Define a set of steps which can be "called" from a run element.
with -- Group together a set of steps that use the same page definition.
Top Elements || All Elements || Tree