Test Output

The following documentation is accurate, but incomplete. Read this file for basic information about how commands are formatted. After reading this document, refer to the unit test output for complete command details. These pages show the setup, test table and test table output for each of the unit tests.

Tables for HtmlFixture


Row One: HtmlFixture, (or com.jbergin.HtmlFixture) entered with "comment braces": HtmlFixture
Alternatively, you can comment the entire table by putting ! to the left of the first | in the table

Row Two: A url or the name of an "element" defined earlier (see Element)
Optionally, you can also name this element for later processing. Provide a second cell with the symbol you want to use later. You can give an optional empty final cell in this row also. If you do, the XML of this element or page will be entered into the cell when you run the test. Depending on this XML, it may actually image. In particular if your "element is a url, then it will image the page in this cell. The XML is loaded locally, however, so some elements may not show up (e.g. gifs with relative urls). Note that some XML will cause the result page to be imaged improperly. It can even appear that some tests (even some tables) are skipped. Use this with caution and don't assume an error in the testing in this situation. Note that the "image" cell can be either cell 2 (if you don't provide a symbolic name) or cell 3 if you do.


Row Three and Following: Any of the following commands in any order. The (case sensitive) keyword goes in column 1. The parameters in the succeeding columns of that row. If a parameter is marked (opt) it is optional and if the cell for it exists but is left blank, then it will be filled in (a query). Otherwise it will be a test and represents an assertion. If a test succeeds the background of the cell is set to green. If it fails, the background is set to red and the actual is given along with the expected value. If a query is made the background is set to medium gray ( #c0c0c0 ) and the actual value entered where the blank originally appeared. If a parameter is marked (omit) in the following you can omit the parameter (and its cell). See Element for an example.

Example:
com.jbergin.HtmlFixture
http://csis.pace.edu/~bergin/gandhi.html homePage
Elements 2
Nodes  
Element 1 head joeHead
Element 2 body joeBody  

Note that this currently parses primarily DOM Element nodes, not all nodes. For example, the page http://csis.pace.edu/~bergin/gandhi.html currently has five nodes, of which only two are element nodes. Some other node types (text node) get special processing as described below. A web page such as the above is represented by the Document Node that forms the page. Some minor processing of the other nodes (mostly query) has been added.

Also note that when you name an element, such as joeHead above, the name and the corresponding element is entered into a hash table with the names as key. Subsequent tables on the same page and even sub pages use this same hash map so that the tables are not entirely independent. The names carry to subsequent pages, however, even to sub-pages. Note that when you Submit the map is cleared (but see Preserve). You can also clear it manually with Clear.

Basic Concepts


HtmlFixture takes a document oriented view of a web page. A document is a hierarchical arrangement of elements specified by tags (types). HtmlFixture lets you navigate this structure and name the elements as you go. At any given time some element in the structure is the "current" element and the commands apply to this element for the most part. We often call the current element the "focus." Initially the current element is specified by the second row of the table that names HtmlFixture in its first row. Thereafter the Focus command (and others that have a focus effect) can be used to change the focus within a table.

The commands that are not marked (meta) apply to the current focus. Some commands are only legal if the focus has a certain type. For example, Submit applies only to anchor elements and form elements.

The Commands



Elements (applies to any page or element)

parameters(2)
(1) number of elements (opt)
(2) the name of a symbol to store the resulting number (opt)

Assert that the number of child elements (of the current element) is as specified or query the number of elements if blank. Optionally store the result in a symbol. See the above example for usage.

HtmlFixture
homePage
Elements 2

For a query use, for example:
HtmlFixture
homePage
Element 2 body joeBody
Elements   numberOfPageElements

Note that the second cell in the fourth row is blank. When you run the test this will be filled in with the actual number of elements (2 in this case).

You can also use (java type) comparison operators before the value to assert that the actual has a certain relationship to the expected value. The accepted operators are: <, <=, >, >=, ==, !=. If no operator is given, equals (==) is assumed.

Example:
HtmlFixture
joeBody
Elements > 5
Assert that the number of child elements is <= 5. This also works in Nodes and Types (only).

Comparisons can be used in combination with symbols as follows:

HtmlFixture
joeBody
Elements > symbol numberOfPageElements
Assert that the number of elements under the body element is greater than the value stored in the symbol numberOfBodyElements.


Element (applies to any page or element)

parameters(3)
(1) the relative number of the element or its id or name as specified in the tag itself. (Counting starts at 1).
(2) the tag type of the cell (opt)
(3) a name for the cell to be used in the second row of other tables or in Focus commands. (omit)
Assert that the specified child element has a given tag and give it a name, or query the tag and give it a name.
You can give an optional fifth cell in an Element row. If so leave it blank and the XML of the element will be generated and put into the cell when you test. If the XML can be imaged by the browser it will be. Some elements are not complete enough to image, but you can still see the XML by looking at the page source of the test result page. If you omit parameter 2 (cell three) then no name will be given to the element. The same is true if the cell is present, but blank.

If there are multiple elements of a given name on a page, enclosing the index in brackets will select the specific instance. (Counting starts at 1).

HtmlFixture
http://localhost/HtmlFixtureDemo.RadioTestPage radioTestPage
Element Focus link_list_div div linkDiv  
Element Focus sub_genre[2] a subGenreLast  

Use the Last Element Token in the index to count backward from the end.

HtmlFixture
radioTestPage
Last Element Token last
Element Focus link_list_div div linkDiv  
Element Focus sub_genre[last] a subGenreLast  
Focus linkDiv
Element Focus sub_genre[last-1] a subGenreSecondToLast  




Focus (Applies to any previously named element or a specified URL)

parameter: the name (or url) of an element that is to become the focus of assertions. The second row in a table is like an implicit Focus command. Subsequent rows of the table will relate to the named element: the element becomes the "current" element. Might leave the current element "null". An optional third cell in the row will be filled with the XML of the named element.

Example:
HtmlFixture
homePage
Element 2 body pageBody
Focus pageBody

Subsequent rows will refer to the body of the page.


Focus Relative (Applies to any previously named element)

parameters(2):
(1) A part of a url that will extend that of the page of the current focus. The url of current will be extended with the text of the parameter and the resulting page retrieved and it will become the new focus.
(2) An optional name for the cell.
The new focus will be imaged if you provide an empty cell after the name cell.

Examples
HtmlFixture
http://www.csis.pace.edu/~bergin
Save berginHome
Focus Relative xp xpPage
Has Text Sorry.
will retrieve http://www.csis.pace.edu/~bergin/xp/

HtmlFixture
berginHome
Focus Relative history.html historyPage
Has Text Site History
will retrieve http://www.csis.pace.edu/~bergin/history.html

Note that if you begin the parameter with / then the page retrieved is relative to the web site itself, not the current page on that site.

Also note that if the current focus is a page like history.html rather than a directory, then relative means relative to the directory of that page.

HtmlFixture
historyPage
Focus Relative index.html
Has Text Computer Science
will retrieve http://csis.pace.edu/index.html

You can also use symbol replacement to specify the parameter.



Get Response

parameters
(1) URL the page to request

The Focus command follows redirects and throws an error for non-200 response codes. This command does not follow redirects. Use this in combination with Response Header, and Status Code commands to make assertions about non-200 status responses.




Status Code

parameters
(1) expected status code (opt)

Asserts that the status code of the last request is as indicated. If the parameter is left blank, the status code is displayed in the cell.




Response Header

parameters
(1) key - the key of the header for the assertion
(2) value - the value to match

Asserts that the most recent web response has the header specified.




Matches Response Header


Same as above, but value is a regular expression




Print Response Headers

parameters
(1) a blank cell to print the result in

This command is for display of all response headers from the most recent page load




Set Request Header

parameters
(1) key
(2) value

Sets a request header for all subsequent http requests




Load Frame

parameters
(1) "top" "parent" or the name of a frame to load

Moves focus to the root element of the indicated html frame.




Focus Parent


Moves the focus to the parent of the current element.




Text Focus


Moves the focus to an element of the indicated type that contains the given text. Note: the element must be the direct parent of the text node that contains the text.
parameters
(1) text to find (required)
(2) type of node (required)
(3) a name for the element to be used in the second row of other tables or in Focus commands. (opt)
(5) blank cell to be filled with resulting XML (opt)

HtmlFixture
http://csis.pace.edu/~bergin/gandhi.html
Text Focus Gandhi h3 gandhiH3  



Print Dom

parameters
(1) empty cell for the results

Prints types and attributes of the DOM starting at the current element in an html table. This command is useful for displaying information while writing tests on an existing system or prototype.




Print Cookies

parameters
(1) empty cell for the results

Prints a list of cookies in the web client in table format.

* set up web client

HtmlFixture
http://localhost
Javascript on
Preserve on


HtmlFixture
http://localhost/HtmlFixtureDemo.SetCookieTestPage
Element Focus set_cookies input
Click cookiePage
Javascript Message  
Print Cookies  




Cookie

paramters
(1) cookie name (required)
(1) cookie value (optional)

Asserts that the web client has a cookie of by the specified name. If a value is supplied, asserts that the value of the cookie is as specified. If value is blank, the value of the cookie will be displayed in the blank cell on test.



HtmlFixture
cookiePage
Cookie favorite_cookie  
Cookie favorite_cookie snickerdoodle
Cookie favorite_cookie chocolate chip
Fail Cookie favorite_cookie
Fail Cookie favorite_cookie snickerdoodle
Fail Cookie favorite_cookie chocolate chip
Fail Cookie second_favorite_cookie  
Fail Cookie second_favorite_cookie
Fail Cookie second_favorite_cookie chocolate chip



Save

parameter: the name to give the current element
The current element is saved in the hash map with the given name. This is especially useful in naming the root element. Most other ways to access an element (Element, for example) have a way to name the retrieved element. An optional third cell in the row will be filled with the XML of the element named.

Example
HtmlFixture
http://csis.pace.edu/~bergin/gandhi.html
Save homePage
You will now be able to use the name homePage in the second row of a table (or in a later Focus command in any table on the same page). Note that this will also save the time it takes to retrieve the page in subsequent uses.


Element Focus

parameters are exactly those of Element and it behaves the same way except that it also sets this element to be the focus of subsequent rows. It is a shorthand for an Element command followed by a Focus command except that it won't set the current element to null. There is no need to set a name for the element to obtain the focus, though you may to allow returning focus to this element in a subsequent test.

Example:
HtmlFixture
homePage
Element Focus 2 body pageBody

Exactly like the Focus example above. Subsequent rows focus on the body of the page.

Note that Element Focus is useful for quick drilling deep into page structure. Element alone is better if you want to do a broad testing of a single element. You can then drill down into its children with Focus.


Text (applies to nodes such as anchor or title tags that contain a text node as a child)

parameter: The text in the element (example: title element) (opt)
Assert that the text in the element has the given text, or query for the text. Requires an exact match.


Has Text (applies to nodes such as anchor or title tags that contain a text node as a child)

parameter: Any substring of the expected text of the element. (opt)
Assert that the parameter is a substring of the actual text.


Matches Text (applies to nodes such as anchor or title tags that contain a text node as a child)

parameters:
(1) A regular expression intended to be matched by the text in the element.
(2) The name of a symbol or a list of symbols separated by spaces to store the matched text (opt)
Assert that the RE is matched by the actual text.
e.g.
HtmlFixture
homePage
Element Focus 1 head pageHead
Type Focus title 1 titleText
Text Gandhi Biography
Has Text hi Bio
Matches Text ^Gandhi.*$ myTitle
Matches Text ^(\w+) (\w+) firstWord secondWord


The last asserts that the title text begins with Gandhi, and stores the complete title in the symbol myTitle.


Attribute (applies to any element with an enclosed attribute)

parameters(3)
(1) name of the attribute
(2) value of the attribute (opt)
(3) an optional symbolic name for the value of the attribute (saved as a symbol)
Assert that the element has an attribute with the given name and value or assert that there is an attribute with the name and query for its value.

e.g.
HtmlFixture
http://csis.pace.edu/~bergin/patterns
Type Focus frame 2
Attribute src select.html select
Focus Relative symbol select  
This will focus on the page referred to in the frame.

The following three tokens/keywords are not assertions, but used to manipulate things on the page




Matches Attribute


Same as the Attribute command, but the value is a regular expression.



Attribute Focus

parameters(5)
(1) Attribute name such as class or href
(2) Attribute value, which can contain an index when multiple elements have the same attribute
(3) Element Type
(4) a name for the element to be used in the second row of other tables or in Focus commands. (opt)
(5) blank cell to be filled with resulting XML (opt)

HtmlFixture
http://localhost/HtmlFixtureDemo.AttributeFocusPage divPage
Last Element Token last
Attribute Focus class top_div div topDiv  
Focus divPage
Attribute Focus class middle_div[2] div middleDiv2  
Focus divPage
Attribute Focus class middle_div[last] div middleDiv3  
Focus divPage
Attribute Focus class middle_div[last-1] div middleDiv2again  
Focus divPage
Attribute Focus class middle_div[4] div middleDiv2again  




Execute (applies to script nodes)

parameter: a condition on which to run this java script element. e.g. onClick
Fire the condition if it is defined for this script element.

Note that the underlying htmlUnit still has only partial support for javascript.


Set Value (applies to input, textarea, and select nodes)

parameter: Text to be entered into this (input, textarea, or select) element.
For a submit the text is used to set the selected attribute of the element. For the others the text is entered.

For select fields, HtmlFixture searches for the text first in the values, then in the display text and finally the label attribute of the options for a match.

You can select an option by index by enclosing the index in brackets.

HtmlFixture
http://localhost/HtmlFixtureDemo.SelectTestPage
Element Focus my_select select mySelect  
Set Value [2]
Focus mySelect  

You can "check" a checkbox or radio button using Set Value to checked. If you set it to an empty string it will be unchecked.

HtmlFixture
http://localhost/HtmlFixtureDemo.RadioTestPage radioTestPage
Element Focus radio_button_test_form form buttonForm  
Element Focus my_radio[2] input radioTwo
Set Value checked
Focus buttonForm  



Append Value (applies to text input and textarea)

parameters
(1) text to add to the current valud of the input





Submit (applies to the current element when it is an anchor, form, or a button inside a form node)

parameter: The name of the page returned.
Click this link or submit this form or button and capture the resulting page. Give it the specified name for further processing. An optional third cell in the row will be filled with the XML of the retrieved page.


Click

A synonym for Submit. Works exactly the same

Submit (and Click) has two side effects. First, it sets the focus (current element) to the page returned by the submission. Second, it clears the hash map, so all names saved till then are lost. You start fresh. The name in the parameter is inserted in the newly emptied hash map along with the page returned. You can toggle this clearing behavior off (and on again) with the Preserve command.




Click Confirm

Does the same as Click and then clicks OK on any javascript confirm dialog that appears.



Preserve

parameters:
(1) on or off to specify setting (opt)

Normally the hash map of element names is cleared whenever you Submit. You can give the Preserve command to change the behavior back and forth from its default behavior. One application of Preserve and the map will no longer be cleared on Submit. The second application will set you back to the default behavior, etc. If the second parameter is specified, the preserve setting can be specified.

You can use this feature to permit complex navigation from page to page (submitting forms, for example) and still be able to return to an earlier page with a minimum of set up for additional tests.




Show SSL Errors

parameters:
(1) on or off to specify the setting (required)

Set this to off to allow for https connection without checking validity of the returned ssl certificate. Useful for test environments with expired ssl certs.



Javascript

parameters:
(1) "on" or "off": setting for Javascript (opt)
In some cases an "onload" javascript can cause a page to fail to load generating an exception. Therefore javascript execution has been turned off for the retrieval of urls.

With no parameter, this command can be used to toggle it back on and off again if this is important to you. Note that even with it off, the Execute command still works. The value is preserved across tables (and pages).

HtmlFixture
joeHead
Javascript
Javascript

With the parameter, the Javascript setting is set directly. This is useful when SetUp? has a Javascript setting for multiple scripts in a suite.

HtmlFixture
joeBody
Javascript on
Javascript on
Javascript off
Javascript off




Show Javascript Errors


Determine whether to throw an exception if javascript on the page encounters errors in execution. Set this to off if you want to run javascript but want to ignore errors. Default setting is "on".

(1) "on" or "off": setting for Javascript (opt)

HtmlFixture
joeBody
Show Javascript Errors off




Javascript Message

parameters
(1) expected message (opt)

Compares the message from the last javascript alert or confirm dialog to expected value. If parameter cell left blank, displays message.





Drag Drop

parameters
(1) name of stored element to drag to

To use this command, first focus on the element you wish to drag to and give it a name. Then focus on the element you wish to drag from and issue the command with the drag to element name as the parameter.

This example clicks on the li with id="one" and drags it on top of the li with id="two"

HtmlFixture
http://localhost/DragDropPage.html thePage
Element Focus two li dragToLi
Focus thePage
Element Focus one li dragFromLi
Drag Drop dragToLi




Timeout

parameters
(1) time in milliseconds

Sets the timeout for the simulated web browser. When loading a page, the browser will wait this amount of time twice - once to set up the connection and once more to get the page. Setting timeout to 0 causes the browser to wait indefinitely.

NOTE: This command also reinitializes the browser. In particular, cookies are reset.

HtmlFixture
joeBody
Timeout 1
Focus http://www.musiciansfriend.com
Timeout 0
Focus http://www.musiciansfriend.com
Timeout 10000
Focus http://www.musiciansfriend.com

Sets the timeout to 1 millisecond and requests home page - this will produce Timeout exception exception. Sets infinite timeout and gets the page, sets timeout of 10 seconds and gets the page.




Soft Timeout

parameters
(1) time in milliseconds

An error will be displayed if page load time is greater than the soft timeout, but the page will load anyway. Useful if you need to detect long page loads, but still want to test a page if the load time is long.




Sleep

parameters
(1) time in milliseconds

Causes the webClient's thread to sleep for specified interval.

This allows for use with asyncronous Ajax to allow for the child thread to complete.

NOTE: Ajax is available in development version >06-2006 of htmlunit.




Clear

parameters (none)
Clear the hash map of names immediately. You may want to do this for sub pages in some cases so as to "forget" the names defined earlier.

The Clear command also restarts the simulated browser. In particular, all cookies are cleared. Without Clear, cookies are held between tables, pages, and even Fixture users.



Types

parameters (2)
(1) A valid type (tag) name (e.g. table or a)
(2) An integer: the asserted number of descendants of the given type (opt)
(3) The name of a symbol in which to store the value (opt)
Assert that the current element has a certain number of descendant elements of the given type. If the third column is blank it will query for the number of descendants of that type. Note that this command considers all descendants of the current element, not just children. See Elements for a comparison operator option on the second parameter.


Type

parameters (3)
(1) A valid type (tag) name (e.g. table or a)
(2) An integer index (one based)
(3) A name for the resulting element (opt)
Assert that there are at least "index" descendant elements with the given type. Give the name to the one at "index". Note that this drills all the way down the tree starting at the current element so it searches all descendants, not just children. It has no query capability. If the third parameter (fourth cell) is missing or is present and blank, no name will be given to the resulting element. An optional fifth cell in the row will be filled with the XML of the specified element.

Example:
HtmlFixture
http://csis.pace.edu/~bergin/gandhi.html homePage
Type p 3 third
Type table 3 filler
Focus third  
Matches Text laborers.$
Among other things, this asserts that the page has at least three tables and tries to name the third one "filler". There is no such element.

One way to think of Type is that it takes a "depth first" or "pre order" view of the html tree. Another is that it just works in textual order on the html code. Element, on the other hand, takes a structural or "breadth first" or "level order" view of the tree.


Type Focus

parameters: Exactly like Type but it also sets the current focus to the element specified unless that would make it null. Similar to the relationship between Element and Element Focus.


Nodes (applies to any element or page)

parameter:
(1) the number of child nodes of this item (opt)
(2) The name of a symbol in which to store the value (opt)
Assert that the item has the specified number of children or query for the number if blank. Note that this one counts all nodes, not just Element nodes. See Elements for a comparison operator option on the parameter.


Node (applies to any element or page)

parameters(2)
(1) the node index relative to the beginning (one based)
(2) the node (type) name (e.g head,.#text ,...) (opt)
Assert that the specified node has the given type. Or query for the type if blank.


Blank Token (meta)

parameter: Any word that you want to use to specify that an element should consist of blank text. The default token is $blank$. The parameter may not be the empty string, however.
Note that the query feature means that if you want to assert that something (a title, perhaps) is really blank, you cannot just leave the table cell blank as it will then be interpreted as a query. To indicate that a certain element should be "blank" specify the (default) token $blank$ to cover this case. To assert an element consists of empty text use this token in the corresponding value cell. The Blank Token command changes the blank token from the default $blank$ to whatever you like.
e.g.
HtmlFixture
http://csis.pace.edu/~bergin/hello.html
Type Focus title 1 titleText
Text $blank$
asserts that the titleText is blank (empty)

HtmlFixture
titleText
Blank Token __blank__
__blank__ will be used instead of $blank$ to indicate an empty string.
HtmlFixture
titleText
Text __blank__
asserts that the titleText is blank. After changing the blank token.



$space$


Use this token to represent a literal space in a value

This is not currently settable



Last Element Token (meta)

parameter: A string that you want to use as the last element contained within the focus (or the last type within the focus)
Note that it is possible to index the elements in Element and Type commands either forward from the first or backward from the last. The forward indexing is 1, 2, 3, ... The backward indexing is 0, -1, -2, ... where 0 is the last element. If you find this irksome, then just define a last element token (say *) using this command and then your token is the name of the last, and the backward indexing will then be *, *-1, *-2, etc. Note that defining the token does not invalidate the standard numeric naming. It is just an alternative

e.g.
HtmlFixture
homePage
Last Element Token last
Element last body pageBody



Symbol (meta)

parameters (2)
(1) name for a new symbol
(2) string value of the symbol
You can use this command to give symbolic names to strings you want to appear in other cells of your tests. This gives a name and a value to your symbol which may then be used later.


You can then use the symbol later by using the name of the symbol prefixed with the "symbol token". The default parameter token is symbol.

e.g.
HtmlFixture
pageHead
Symbol big > 10
Elements symbol big

Note that the symbol token must appear at the beginning of the cell contents. The value of the parameter will be used instead. In other words, with the above definition, this command is just like:

|Elements| > 10|

Symbols may be used in combination with comparison operators (<, >, <=, >=) as follows:

HtmlFixture
pageHead
Symbol bigNumber 10
Elements > symbol bigNumber




Symbol Token

parameter: The token used to introduce a symbol in a cell. The default is the word: symbol. You may replace this with any non empty string. You may need to do this if the value of the default token is important to your testing.


List (meta)

parameters
(1) A name for the list
(2...n) values to be stored in the list. Any string values.
A List is a symbol with a given name but many values. The values in the symbol can be obtained by indexing from one. This command has a variable number of cells. The values are indexed in the same order you write them, starting with 1.

e.g.
HtmlFixture
homePage
List values Charlemagne Gandhi Sun Tsu
Type Focus title 1
Has Text symbol values[2]
Note that the symbol prefix must be given, then the name of the symbol, then the index desired.


Fail

The fail command is a modifier for many other commands. You use it by putting Fail in a cell alone, before any other command (some ignore it). The intent is to reverse the sense of the test.

e.g.
HtmlFixture
homePage
Fail Elements 3
Assert that the number of elements of the current focus is NOT 3. Assert that |Elements | 3 | will fail.

Fail applies to the following commands: Attribute, Element, Elements, Has Text, Matches Text, Node, Nodes, Text, Type, and Types. The others will fail it if it is present, ignoring the rest of the row.

HtmlFixture
homePage
Fail Attribute foo bar
will succeed if current either has no foo attribute or if it does but its value is not bar.

HtmlFixture
homePage
Fail Element 3 body
will succeed if element 3 of current is not body

HtmlFixture
homePage
Fail Elements 3
will succeed if the number of elements in current is not 3

HtmlFixture
homePage
Fail Has Text foo
will succeed if foo cannot be found in the text part of the element

HtmlFixture
homePage
Fail Matches Text ^EBY
will succeed if EBY does not appear at the beginning of current

HtmlFixture
homePage
Fail Node 4 #text
will succeed if node 4 is not a.#text node

HtmlFixture
homePage
Fail Nodes 3
will succeed if current has other than 3 sub nodes

HtmlFixture
homePage
Fail Text foo
will succeed if the text in current is not foo.

HtmlFixture
homePage
Fail Type body 2
will succeed if there are other than 2 body elements within current

HtmlFixture
homePage
Fail Types Input 3
will succeed if current has other than 3 input elements.

Note that saving of name-element pairs is suspended for all Fail commands (there is nothing to name). The imaging of XML works for some, but not all.
For example |Fail |Element |3| body | | | will show you element 3 in the last cell unless an exception occurs. Querying works as usual for Fail commands.

Some of the Fail combinations seem superfluous or even silly (even to the author). An attempt was made to make the rules as uniform as possible and to do a sensible thing in all cases. In the case of the other commands, applying Fail will itself fail. |Fail |Submit | ... will fail and the Submit... part will be ignored.

There are other ways to do some of the things Fail can do. For example
|Elements| != 3| is the same as |Fail |Elements | 3 |.

fit.Summary


Notes.


There are three different kinds of symbols/names/variables that you can use to build your tests for this fixture. First you may use fitnesse variables. See http://fitnesse.org/FitNesse.MarkupVariables. These can be used to set part of a cell as well as an entire cell. However, the syntax of variable access is fixed. Next are the names given to elements when you give various commands here, such as Element, or Save. Finally are the symbols defined by the Symbol and Attribute commands that can be used to fill an entire cell. Note that the Clear command clears only the names (of elements), not the variables or the symbols.

This version will sometimes generate messages on standard out (visible in the error log) of the form
org.apache.commons.httpclient.HttpMethodBase processRedirectResponse INFO: Redirect requested but followRedirects is disabled
This is due to the support for version 2 of org.apache.commons.httpclient code. It does not indicate an error. The diagnostic occurs when you give a URL that does not end in a /, causing a redirection. Browsers handle this seamlessly, but the apache code distinguishes the cases.

To see the complete fitnesse wiki markup rules see: http://fitnesse.org/FitNesse.WikiInstructions

[.FrontPage] [.RecentChanges]