The root element of a xml test script.
These pages are intended as a reference manual and detail the elements and attributes which can be used in a test script. Where possible examples are provided.
To give a very simple overview of what a xml test script, the following illustrates how to check the links on a page.
<?xml version="1.0" ?> <!DOCTYPE testSpec SYSTEM "test.dtd"> <testSpec application="..." baseURL="http://server/"> <steps> <fetch url="http://server/..."/> <verifylinks/> </steps> </testSpec>
The following is a more complex example, which verifies the contents of the fectched pages, and the changes to certain database tables.
<?xml version="1.0" ?> <!DOCTYPE testSpec SYSTEM "test.dtd"> <testSpec application="..." baseURL="http://server/"> <database dbdriver = "..." dbconnection = "..."> <dbTable name="Customers" identity="CustomerId"/> <dbTable name="Suppliers" identity="SupplierId"/> <dbTable name="log" identity="LogId"/> </database> <steps stepid="testAll"> <with page="login"/> <fetch/> <verify/> <submit/> </with> <verify page="default"/> <with page="newCustomer"/> <fetch/> <verify/> <submit/> </with> </steps> <definePage name="login" url="...> <form id="form" name="form" action="..." method="post"> <dbInsert dbTable="log" id="userid"/> <input name="Name" type="text" set="..."/> <input name="Password" type="text" set="..."/> </form> </definePage> <definePage name="default" url="..."> <frameset url="default.cfm" name="mainframeset"> <frame type="main" name="..." url="..." /> <frame name="header"/> <frame name="hidden"/> </frameset> </definePage> <testSpec/>Click on the links below for more details of what can be used in a xml test script.
browser -- Specifies the attributes of the XmlTestSuite web browser
database -- Optional. Specifies the set of database tables to be monitored during testing.
definepage -- Used to define the structure of a html page
definepages -- Allows definePage elements to be grouped together.
steps -- This element contains all the test steps.
Attribute Value(s) Default Value application Used to document the name of the application being tested
CDATA#REQUIRED baseurl Optional url prefix to be applied to all urls in testing. e.g.
baseURL="http://servername"CDATA#REQUIRED
( browser | database | definepage | definepages | steps ) *
None
Top Elements || All Elements || Tree