Available Tags

This is a list of available tags for Watij Plug-in. This list of tags is also available in the Jameleon GUI. You can get there by selecting the "Functional Points" tab on the lower-left. All tags, including custom tags and other enabled plug-ins' tags, show up in the GUI.

Watij Plug-in Tags

TagShort Description
<watij-assert-html-element/>Gets an HtmlElement on the page and validates its attributes and inner text.
<watij-assert-text/>Asserts that that the given text exists or doesn't exist on a page.
<watij-assert-text-field/>Gets a text field on the page and validates its attributes.
<watij-assert-title/>Asserts that the title is what is expected.
<watij-back/>Click the browser's back button.
<watij-bring-to-front/>Brings the window defined by childBrowserIndex to the front and makes it active.
<watij-checkbox/>Gets a checkbox on the page and stores in the context.
<watij-click/>Clicks on a given HtmlElement or an elemented defined by how and what.
<watij-click-link/>Gets a link on the page and clicks on it if found.
<watij-contains-text/>Looks for the given text on the page.
<watij-execute-script/>Click on a given HtmlElement.
<watij-file-field/>Gets a file field and stores it in the context for use in another tag or the script.
<watij-forward/>Click the browser's forward button.
<watij-goto/>Navigates to a given URL.
<watij-hidden/>Gets a hidden field and stores it in the context for use in another tag or the script.
<watij-html-element/>Gets an HtmlElement on the page and stores in the context.
<watij-image/>Gets an image on the page and stores in the context.
<watij-link/>Gets a link on the page and stores in the context.
<watij-radio/>Gets a radio button on the page and stores in the context.
<watij-refresh/>Presses the browser's refresh button.
<watij-select-list/>Gets a select list on the page and stores in the context.
<watij-select-list-option/>Gets a select list on the page and stores in the context.
<watij-send-keys/>Sends keystrokes to the screen.
<watij-session/>A Session tag for the Watij plug-in.
<watij-set-checkbox/>Gets a checkbox on the page and stores in the context.
<watij-set-file-field/>Sets the value of a file field.
<watij-set-hidden/>Sets the value of a hidden field.
<watij-set-radio/>Gets a radio button on the page and stores it in the context.
<watij-set-select-list/>Selects a given option of a select list.
<watij-set-select-list-option/>Selects a given option of a select list.
<watij-set-text-field/>Sets the value of a text, password, or textarea field.
<watij-text-field/>Gets a text, password, or textarea field and stores it in the context for use in another tag or the script.
<watij-title/>Gets the title of the page and stores it in the context.

watij-assert-html-element

Gets an HtmlElement on the page and validates its attributes and inner text. For example, to get a button on the page and verify various things about it:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net/jiffie-plugin/forms/sampleForm.html" beginSession="true">
<watij-assert-html-element
functionId="Validate the 'submit' button"
how="name"
what="submit"
value="Go"
type="button"
/>
</watij-session>
</testcase>
To simply test that the element exists:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net/jiffie-plugin/forms/sampleForm.html" beginSession="true">
<watij-assert-html-element
functionId="Validate the 'submit' button"
how="name"
what="submit"
/>
</watij-session>
</testcase>
To test that the element does not exist:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net/jiffie-plugin/forms/sampleForm.html" beginSession="true">
<watij-assert-html-element
functionId="Validate the 'submit' button"
how="name"
what="submit"
exists="false"
/>
</watij-session>
</testcase>
To verify the followig XPath returns a tag:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net/jiffie-plugin/forms/sampleForm.html" beginSession="true">
<watij-assert-html-element
functionId="Validate the 'submit' button"
how="xpath"
what="//INPUT[@name='submit']"
/>
</watij-session>
</testcase>
The above can then be used to verify various other things once the tag is returned. However, XPath should be able to verify everything w/o having to do additional validation of the attributes. If only symbol and element are defined, then the tag will be tested for existence. See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
exists

To check that it exists or not. If set to false, then the tag will if the element exists.

truefalseboolean
disabled

To validate the element is enabled set this to false. To validate the element is disalbed set this to true.

falsejava.lang.Boolean
id

The expected id

falsejava.lang.String
innerText

The inner text of the element

falsejava.lang.String
name

The name of the element

falsejava.lang.String
style

The style of the element

falsejava.lang.String
text

The text nested in the element

falsejava.lang.String
title

The title nested in the element

falsejava.lang.String
type

The type of the element

falsejava.lang.String
value

The value of the element

falsejava.lang.String
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-assert-text

Asserts that that the given text exists or doesn't exist on a page. An example of its use might be to test that 'testing' exists on a page:

    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-assert-text
functionId="Check that 'testing' is on the page."
text="testing"/>
</watij-session>
</testcase>
Another example might be to test that 'some strange sentence' doesn't exists on a page:
    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-assert-text
functionId="Check that 'testing' is on the page."
text="testing"
failIfFound="true"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
text

The text to check for against the currently active IE.

truejava.lang.String
msg

The error message to display if the assert fails.

falsejava.lang.String
failIfFound

Fail if the given text is found.

falsefalsejava.lang.Boolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-assert-text-field

Gets a text field on the page and validates its attributes. For example:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net/jiffie-plugin/forms/sampleForm.html" beginSession="true">
<watij-assert-text-field
functionId="Validate the 'username' text field"
how="name"
what="j_username"
value="joe"
type="text"
/>
</watij-session>
</testcase>
To simply test that the element exists:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net/jiffie-plugin/forms/sampleForm.html" beginSession="true">
<watij-assert-test-field
functionId="Validate the 'j_username' text field exists"
how="name"
what="j_username"
/>
</watij-session>
</testcase>
To test that the element does not exist:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net/jiffie-plugin/forms/sampleForm.html" beginSession="true">
<watij-assert-html-element
functionId="Validate that the 'j_password' field does not exist"
how="name"
what="j_username"
exists="false"
/>
</watij-session>
</testcase>
If only symbol and element are defined, then the tag will be tested for existence. See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
exists

To check that it exists or not. If set to false, then the tag will if the element exists.

truefalseboolean
disabled

To validate the element is enabled set this to false. To validate the element is disalbed set this to true.

falsejava.lang.Boolean
id

The expected id

falsejava.lang.String
innerText

The inner text of the element

falsejava.lang.String
name

The name of the element

falsejava.lang.String
style

The style of the element

falsejava.lang.String
text

The text nested in the element

falsejava.lang.String
title

The title nested in the element

falsejava.lang.String
type

The type of the element

falsejava.lang.String
value

The value of the element

falsejava.lang.String
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-assert-title

Asserts that the title is what is expected. An example of its use might be to test that the title is 'testing':

    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-assert-title
functionId="Check that the title is 'testing'."
title="testing"/>
</watij-session>
</testcase>
To include an error message besides the default "title":
    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-assert-title
functionId="Check that the title is 'testing'."
title="testing"
msg="Home page title"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
title

The expected title of the current page.

falsejava.lang.String
msg

The message to display if the tag fails.

falsejava.lang.String
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-back

Click the browser's back button. An example of its use might be:

    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-click-link
functionId="Click on the 'Overview' link."
link="Overview"/>
<watij-back
functionId="Go back to the home page."/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-bring-to-front

Brings the window defined by childBrowserIndex to the front and makes it active. This tag will wait up to a minute for the new window to display before failing. For example, to bring the 2nd window to the front:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-bring-to-front
functionId="Bring 2nd window up to the front"
childBrowserIndex="1"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
childBrowserIndex

The index number of the child browser to activate where the 1st child is 0.

falsejava.lang.Integer
parentBrowser

Bring the original browser back into focus.

falsefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-checkbox

Gets a checkbox on the page and stores in the context. An example might be to get a checkbox button via its name:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-checkbox
functionId="Gets a checkbox vi its name"
how="name"
what="checkboxName"
contextVar="watijCheckbox"/>
</watij-session>
</testcase>
Maybe there are several checkboxes buttons with the same name:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-checkbox
functionId="Gets a checkbox via its name and value"
how="name"
what="checkName"
value="val2"
contextVar="checkbox2"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
value

The value of the form field. This is for form fields that all have the same name, but different values.

falsejava.lang.String
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-click

Clicks on a given HtmlElement or an elemented defined by how and what. An example of its use might be to click on a link:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-click
functionId="Click on the 'some link' link"
how="text"
what="some link"/>
</watij-session>
</testcase>
Or to click on an image defined by XPath:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-click
functionId="Click on an image the alt text, 'some image'"
how="xpath"
what="//IMG[@alt='some image']"/>
</watij-session>
</testcase>
Or to click on an image defined by its alt text:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-click
functionId="Click on an image the alt text, 'some image'"
how="alt"
what="some image"/>
</watij-session>
</testcase>
Or to click on a link found via the watij-link tag:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-link
functionId="Get the 'some link' link"
how="text"
what="some link"/>
<watij-click
functionId="Click on the 'some link' link"
element="${watijLink}"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

falsejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

falsejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
element

The HtmlElement to click.

falsewatij.elements.HtmlElement
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-click-link

Gets a link on the page and clicks on it if found. If a matching link is not found, this tag will fail. An example of its use might be to click on a link via its underlined text:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-click-link
functionId="Click on the 'some link' link"
how="text"
what="some link"/>
</watij-session>
</testcase>
Maybe there are several links with the same text and the one of interest has a and id attribute of '42':
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-click-link
functionId="Click on the link with its id attribute of 42"
how="id"
what="42"/>
</watij-session>
</testcase>
To use Xpath:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-click-link
functionId="Click on the link defined by XPath"
how="xpath"
what="//A[@id='42' and text()='some link']"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-contains-text

Looks for the given text on the page. It then stores whether it was found or not under the provided context variable name. An example of its use might be:

    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-contains-text
functionId="Check that the word 'Testing' exists on the page."
text="Testing"/>
<ju-assert-true
functionId="Validate that the text was found"
test="${watijTextPresent}"/>
</watij-session>
</testcase>
To change the context variable name:
    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-contains-text
functionId="Check that the word 'Testing' exists on the page."
text="Testing"
contextVar="testingExists"/>
<ju-assert-true
functionId="Validate that the text was found"
test="${testingExists}"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
text

The text to check for against the currently active IE.

falsejava.lang.String
contextVar

The context variable to store the title in

watijTextPresenttruejava.lang.String
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-execute-script

Click on a given HtmlElement. An example of its use might be to change the title of the page to 'new title':

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-execute-script
functionId="change the title to 'new title'"
script="document.title='new title'"/>
</watij-session>
</testcase>
To change the background color of a text field:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-execute-script
functionId="change the title to 'new title'"
script="document.forms.some_form.username.style.backgroundColor= '#CCFF33'"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
script

The JavaScript to execute.

truejava.lang.String
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-file-field

Gets a file field and stores it in the context for use in another tag or the script. Some example uses might be: To get the file field by name

    
<watij-file-field functionId="Get the file field named 'ff'"
how="name"
what="ff"
contextVar="fileField"/>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-forward

Click the browser's forward button. An example of its use might be:

    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-click-link
functionId="Click on the 'Overview' link."
link="Overview"/>
<watij-back
functionId="Go back to the home page."/>
<watij-forward
functionId="Go to the Overview page."/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-goto

Navigates to a given URL. An example of its use might be to go to the jameleon.sourceforge.net website:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session>
<watij-goto
functionId="Go to Jameleon's site"
url="http://jameleon.sourceforge.net"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
url

The url to navigate to.

truejava.lang.String
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-hidden

Gets a hidden field and stores it in the context for use in another tag or the script. Some example uses might be: To get the hidden field defined by <input type="hidden" name="hf"</a>

    
<watij-hidden functionId="Get the hidden field named 'hf'"
how="name"
what="hf"
contextVar="hidden"/>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-html-element

Gets an HtmlElement on the page and stores in the context. An example of its use might be to click on a link via its underlined text:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-html-element
functionId="Get the 'some link' link"
how="text"
what="some link"
contextVar="watijHtmlElement"/>
<watij-click
functionId="Click on the 'some link' link"
element="${watijHtmlElement}"/>
</watij-session>
</testcase>
Maybe there are several links with the same text and the one of interest has a and id attribute of '42' and you want to use a more specific context variable name like 'link42':
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-html-element
functionId="Get the link with the id of '42'"
how="id"
what="42"
contextVar="link42"/>
<watij-click
functionId="Click on the link"
element="${link42}"/>
</watij-session>
</testcase>
To get a form field via XPath (the default symbol):
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-html-element
functionId="Get the j_username form field"
how="xpath"
what="//FORM//INPUT[@name='j_username']"
contextVar="usernameField"/>
<ju-assert-true
functionId="Make sure the field exists"
test="${usernameField.exists()}"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-image

Gets an image on the page and stores in the context. An example of its use might be to click on an image found via its alt text of 'Find Pets':

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-image
functionId="Get the 'Find Pets' image"
how="alt"
what="Find Pets"
contextVar="watijImage"/>
<watij-click
functionId="Click on the image"
element="${watijImage}"/>
</watij-session>
</testcase>
Or maybe there is no alt text so something like XPath is more appropriate and you want a more specific context variable:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-image
functionId="Get the 'Find Pets' image"
how="xpath"
what="//TABLE[@id='nav_table']//'IMG[2]"
contextVar="img_2"/>
<watij-click
functionId="Click on the image"
element="${img_2}"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-link

Gets a link on the page and stores in the context. An example of its use might be to click on a link via its underlined text:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-link
functionId="Get the 'some link' link"
how="text"
what="some link"
contextVar="watijLink"/>
<watij-click
functionId="Click on the 'some link' link"
element="${watijLink}"/>
</watij-session>
</testcase>
Maybe there are several links with the same text and the one of interest has a and id attribute of '42' and you want to use a more specific context variable name like 'link42':
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-link
functionId="Get the link with the id of '42'"
how="id"
what="42"
contextVar="link42"/>
<watij-click
functionId="Click on the link"
element="${link42}"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-radio

Gets a radio button on the page and stores in the context. An example might be to get a radio button via its name:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-radio
functionId="Gets a radio button vi its name"
how="name"
what="radioName"
contextVar="watijRadio"/>
</watij-session>
</testcase>
Maybe there are several radio buttons with the same name:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-radio
functionId="Gets a radio button via its name and value"
how="name"
what="radioName"
value="val2"
contextVar="watijRadio"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
value

The value of the form field. This is for form fields that all have the same name, but different values.

falsejava.lang.String
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-refresh

Presses the browser's refresh button. An example of its use might be:

    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-refresh
functionId="Refresh the homepage."/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-select-list

Gets a select list on the page and stores in the context.

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-select-list
functionId="Gets a select list"
how="xpath"
what="//SELECT[@name='selectFieldName']"
contextVar="selectList"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-select-list-option

Gets a select list on the page and stores in the context.

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-select-list
functionId="Gets a select list"
how="xpath"
what="//SELECT[@name='server_name']/OPTION[contains(text(), 'MWI')]"
select="true/false"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-send-keys

Sends keystrokes to the screen. This tag can be useful for hard to automated situations. This tag will wait up to a minute for the window with expected title to spawn. For example, to send keys to the current window:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-send-keys
functionId="send two tabs to the current window"
keys="{TAB}{TAB}"/>
</watij-session>
</testcase>
For example, to send keys to the window titled 'Calculator':
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-send-keys
functionId="send two tabs to the window titled 'Calculator'"
title="Calculator"
keys="1+1{ENTER}"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
keys

The keys to send to the screen

falsejava.lang.String
title

The title of the window to activate before sending the keys

falsejava.lang.String
blocking

To block while the keys are being sent or not.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-session

A Session tag for the Watij plug-in. An example of its use might:

    
<testcase xmlns="jelly:jameleon">
<watij-session baseUrl="http://www.google.com" beginSession="true">
<watij-assert-title
functionId="Check that title is Google."
title="Google"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
baseUrlbaseUrl

falsejava.lang.String
beginAtbeginAt

falsejava.lang.String
application

The name of the application being run according to the *-TestCaseTag.properties file

falsejava.lang.String
organization

The organization (affiliate or company name) this application will be tested against.

falsejava.lang.String
postcondition

falseboolean
sessionDelay

Sets the tag to delay x milliseconds before anything else is executed.

0falselong
beginSession

Starts the applicattion and gets it to the state defined in the $testEnviroment-Applications.properties. DEFAULTS to false

falseboolean

watij-set-checkbox

Gets a checkbox on the page and stores in the context. An example might be to check a checkbox via its name:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-checkbox
functionId="Gets a checkbox via its name"
how="name"
what="checkboxName"/>
</watij-session>
</testcase>
Maybe there are several checkboxs with the same name:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-checkbox
functionId="Gets a checkbox via its name and value"
how="name"
what="cbName"
value="val2"/>
</watij-session>
</testcase>
To uncheck a checkbox:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-checkbox
functionId="Gets a checkbox via its name and value"
how="name"
what="cbName"
value="val2"
setOrClear="false"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
setOrClear

Selects/clears the checkbox

truefalseboolean
value

The value of the form field. This is for form fields that all have the same name, but different values.

falsejava.lang.String
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-set-file-field

Sets the value of a file field. Some example uses might be: Setting the file field by name

    
<watij-set-file-field functionId="Set a value of the text field to 'some value'"
how="name"
what="ff1"
value="some value"/>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
value

The text to enter into the file field

falsejava.lang.String
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-set-hidden

Sets the value of a hidden field. To set the hidden field defined by <input type="hidden" name="hf"</a>

    
<watij-hidden functionId="Get the hidden field named 'hf'"
how="name"
what="hf"
value="new value"/>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
value

The text to enter into the hidden field

falsejava.lang.String
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-set-radio

Gets a radio button on the page and stores it in the context. An example might be to check a radio button via its name:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-radio
functionId="Gets a radio button vi its name"
how="name"
what="radioName"/>
</watij-session>
</testcase>
Maybe there are several radio buttons with the same name:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-radio
functionId="Gets a radio button via its name and value"
how="name"
what="radioName"
value="val2"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
value

The value of the form field. This is for form fields that all have the same name, but different values.

falsejava.lang.String
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-set-select-list

Selects a given option of a select list. For example, set a select field by the displayed text option (<option>two</option>):

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list
functionId="Set the 'two' option of a select field"
how="name"
what="selectFieldName"
select="two"/>
</watij-session>
</testcase>
To select the option by its value attribute setting (<option value="2">two</option>)
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list
functionId="Set the 'two' option of a select field"
how="xpath"
what="//SELECT[@name='selectFieldName']"
selectValue="2"/>
</watij-session>
</testcase>
To clear the selected option(s):
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list
functionId="Clear the selected options"
how="xpath"
what="//SELECT[@name='selectFieldName']"
clearSelection="true"/>
</watij-session>
</testcase>
To select multiple values (2, and 3) against a multi select list:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list
functionId="Set the 'two' option of a select field"
how="xpath"
what="//SELECT[@name='selectFieldName']"
selectValue="2"/>
<watij-set-select-list
functionId="Set the 'two' option of a select field"
how="name"
what="selectFieldName"
select="three"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
select

Select the option with the matching displayed text

falsejava.lang.String
selectValue

Select the option with the matching value attribute's value

falsejava.lang.String
clearSelection

Clear the optioh selection. If this is true and select or selectValue are set, then the list will be cleared first, and the new option will be selected. This option is for multi select boxes only.

falsefalseboolean
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-set-select-list-option

Selects a given option of a select list. For example, set a select field by the displayed text option (<option>two</option>):

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list-option
functionId="Set the 'two' option of a select field"
how="xpath"
what="//SELECT[@name='server_name']/OPTION[contains(text(), 'something two')]" />
</watij-session>
</testcase>
To select the option by its value attribute setting (<option value="2">two</option>)
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list-option
functionId="Set the 'two' option of a select field"
how="name"
what="two']"
/>
</watij-session>
</testcase>


To clear the selected option(s): Use watij-set-select-list to clear ! API not functioning properly here
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://some.url/some/path" beginSession="true">
<watij-set-select-list-option
functionId="Clear the selected options"
how="name"
what="firstoption"
select="false"/>
</watij-session>
</testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
select

Select the option with the matching displayed text

truefalseboolean
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-set-text-field

Sets the value of a text, password, or textarea field. Some example uses might be: Setting the text field defined by <input type="text" name="textField1"</a>

    
<watij-set-text-field functionId="Set a value of the text field to 'some value'"
how="name"
what="textField1"
value="some value"/>
Setting the text field defined by <input type="text" id="textField1"</a>
    
<watij-set-text-field functionId="Set a value of the text field to 'some value'"
how="id"
what="textField1"
value="some value"/>
Setting the text field defined by <input type="text" id="textField1"</a> which exists in a form named 'form1'
    
<watij-set-text-field functionId="Set a value of the text field to 'some value'"
how="xpath"
what="//FORM[@name='form1']//INPUT[@type='password' and @id='textField1']"
value="some value"/>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
value

The text to enter into the text field

falsejava.lang.String
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-text-field

Gets a text, password, or textarea field and stores it in the context for use in another tag or the script. Some example uses might be: To get the text field defined by <input type="text" name="textField1"</a>

    
<watij-text-field functionId="Get the text field named 'textField1'"
how="name"
what="textField1"
contextVar="tField"/>
To get the text field defined by <input type="text" id="textField1"</a>
    
<watij-text-field functionId="Get the text field with the id'textField1'."
how="id"
what="textField1"
contextVar="textField"/>
To get the text field defined by <input type="text" id="textField1"</a> which exists in a form named 'form1'
    
<watij-set-text-field functionId="Get a text field via xpath"
how="xpath"
what="//FORM[@name='form1']//INPUT[@type='password' and @id='textField1']"
contextVar="textField"/>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
how

The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath).

truejava.lang.String
what

The identifier of the symbol. For example, if symbol is set to name then field would be set to the name of the field.

truejava.lang.String
contextVar

The context variable to store the element in.

htmlElementtruejava.lang.String
failOnNotExists

Fail if the field doesn't exist.

truefalseboolean
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong

watij-title

Gets the title of the page and stores it in the context. An example of its use might be to get the title and do logic on it:

    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-title
functionId="Check that the title is 'testing'."/>
<j:if test="${watijTitle eq 'some title'">
<watij-click-link
functionId="Click on the 'some link' link"
link="some link"/>
</j:if>
<j:if test="${watijTitle eq 'some other title'">
<watij-click-link
functionId="Click on the 'some other link' link"
link="some other link"/>
</j:if>
</watij-session>
</testcase>
To store the title in a context variable other than the default:
    
<testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
<watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
<watij-title
functionId="Check that the title is 'testing'."
contextVar="testingLink"/>
<some-tag functionId="use the ${testingLink} title variable"/>
</watij-session>
</testcase>

Take a look at this tag's API docs and source code for more information.

Attribute NameContext NameDescriptionDefaultRequiredType
contextVar

The context variable to store the title in

watijTitletruejava.lang.String
functionId

The id of this function. This is used in the macro as a short description of the function

truejava.lang.String
breakPoint

Tells the GUI to stop at this functional point

falseboolean
precondition

Specifies this is a precondition

falseboolean
postcondition

Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed.

falseboolean
expectFailure

Specifies a failure is expected.

falseboolean
expectException

Specifies an exception is expected.

falseboolean
functionDelay

The delay time to use at the end of each functional point

-1falselong