FETCH

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.html
https 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

Fetching a frameset automatically fetches the frames in the frameset. The url can be supplemented with the query string attribute

        <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.


1. Allowed Content

EMPTY

2. Attributes

AttributeValue(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

3. Content Declaration

Empty

4. Parent Elements

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


test DTD