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.
Tag | Short 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. |
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" value="Go" type="button" /> </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" /> </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="name" what="submit" exists="false" /> </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.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
exists |
To check that it exists or not. If set to false, then the tag will if the element exists. | true | false | boolean | |
disabled |
To validate the element is enabled set this to false. To validate the element is disalbed set this to true. | false | java.lang.Boolean | ||
id |
The expected id | false | java.lang.String | ||
innerText |
The inner text of the element | false | java.lang.String | ||
name |
The name of the element | false | java.lang.String | ||
style |
The style of the element | false | java.lang.String | ||
text |
The text nested in the element | false | java.lang.String | ||
title |
The title nested in the element | false | java.lang.String | ||
type |
The type of the element | false | java.lang.String | ||
value |
The value of the element | false | java.lang.String | ||
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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"/> </watij-session> </testcase>
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
text |
The text to check for against the currently active IE. | true | java.lang.String | ||
msg |
The error message to display if the assert fails. | false | java.lang.String | ||
failIfFound |
Fail if the given text is found. | false | false | java.lang.Boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
Gets a text field on the page and validates its attributes. For example:
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-text-field functionId="Validate the 'username' text field" how="name" what="j_username" value="joe" type="text" /> </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-test-field functionId="Validate the 'j_username' text field exists" how="name" what="j_username" /> </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.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
exists |
To check that it exists or not. If set to false, then the tag will if the element exists. | true | false | boolean | |
disabled |
To validate the element is enabled set this to false. To validate the element is disalbed set this to true. | false | java.lang.Boolean | ||
id |
The expected id | false | java.lang.String | ||
innerText |
The inner text of the element | false | java.lang.String | ||
name |
The name of the element | false | java.lang.String | ||
style |
The style of the element | false | java.lang.String | ||
text |
The text nested in the element | false | java.lang.String | ||
title |
The title nested in the element | false | java.lang.String | ||
type |
The type of the element | false | java.lang.String | ||
value |
The value of the element | false | java.lang.String | ||
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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"/> </watij-session> </testcase>
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
title |
The expected title of the current page. | false | java.lang.String | ||
msg |
The message to display if the tag fails. | false | java.lang.String | ||
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
childBrowserIndex |
The index number of the child browser to activate where the 1st child is | false | java.lang.Integer | ||
parentBrowser |
Bring the original browser back into focus. | false | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 vi its name" how="name" what="checkboxName" contextVar="watijCheckbox"/> </watij-session> </testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
value |
The value of the form field. This is for form fields that all have the same name, but different values. | false | java.lang.String | ||
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 the 'some link' link" how="text" what="some link"/> </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="xpath" what="//IMG[@alt='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-click functionId="Click on an image the alt text, 'some image'" how="alt" what="some image"/> </watij-session> </testcase>
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | false | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | false | java.lang.String | ||
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
element |
The HtmlElement to click. | false | watij.elements.HtmlElement | ||
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 'some link' link" how="text" what="some link"/> </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 with its id attribute of 42" how="id" what="42"/> </watij-session> </testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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"/> <ju-assert-true functionId="Validate that the text was found" test="${watijTextPresent}"/> </watij-session> </testcase>
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
text |
The text to check for against the currently active IE. | false | java.lang.String | ||
contextVar |
The context variable to store the title in | watijTextPresent | true | java.lang.String | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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.title='new title'"/> </watij-session> </testcase>
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
script |
The JavaScript to execute. | true | java.lang.String | ||
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<watij-file-field functionId="Get the file field named 'ff'" how="name" what="ff" contextVar="fileField"/>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
url |
The url to navigate to. | true | java.lang.String | ||
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<watij-hidden functionId="Get the hidden field named 'hf'" how="name" what="hf" contextVar="hidden"/>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 'some link' link" how="text" what="some link" contextVar="watijHtmlElement"/> <watij-click functionId="Click on the 'some link' link" element="${watijHtmlElement}"/> </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 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.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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="alt" what="Find Pets" contextVar="watijImage"/> <watij-click functionId="Click on the image" element="${watijImage}"/> </watij-session> </testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 'some link' link" how="text" what="some link" contextVar="watijLink"/> <watij-click functionId="Click on the 'some link' link" element="${watijLink}"/> </watij-session> </testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 vi its name" how="name" what="radioName" contextVar="watijRadio"/> </watij-session> </testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
value |
The value of the form field. This is for form fields that all have the same name, but different values. | false | java.lang.String | ||
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
Gets a select list on the page and stores in the context.
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
Gets a select list on the page and stores in the context.
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 current window" keys="{TAB}{TAB}"/> </watij-session> </testcase>
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
keys |
The keys to send to the screen | false | java.lang.String | ||
title |
The title of the window to activate before sending the keys | false | java.lang.String | ||
blocking |
To block while the keys are being sent or not. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
baseUrl | baseUrl |
| false | java.lang.String | |
beginAt | beginAt |
| false | java.lang.String | |
application |
The name of the application being run according to the *-TestCaseTag.properties file | false | java.lang.String | ||
organization |
The organization (affiliate or company name) this application will be tested against. | false | java.lang.String | ||
postcondition |
| false | boolean | ||
sessionDelay |
Sets the tag to delay x milliseconds before anything else is executed. | 0 | false | long | |
beginSession |
Starts the applicattion and gets it to the state defined in the $testEnviroment-Applications.properties.
DEFAULTS to | false | boolean |
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" how="name" what="checkboxName"/> </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"/> </watij-session> </testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
setOrClear |
Selects/clears the checkbox | true | false | boolean | |
value |
The value of the form field. This is for form fields that all have the same name, but different values. | false | java.lang.String | ||
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
value |
The text to enter into the file field | false | java.lang.String | ||
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
value |
The text to enter into the hidden field | false | java.lang.String | ||
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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 vi its name" how="name" what="radioName"/> </watij-session> </testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
value |
The value of the form field. This is for form fields that all have the same name, but different values. | false | java.lang.String | ||
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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="name" what="selectFieldName" select="two"/> </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="Set the 'two' option of a select field" how="xpath" what="//SELECT[@name='selectFieldName']" selectValue="2"/> </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="Clear the selected options" how="xpath" what="//SELECT[@name='selectFieldName']" clearSelection="true"/> </watij-session> </testcase>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
select |
Select the option with the matching displayed text | false | java.lang.String | ||
selectValue |
Select the option with the matching value attribute's value | false | java.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. | false | false | boolean | |
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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="xpath" what="//SELECT[@name='server_name']/OPTION[contains(text(), 'something two')]" /> </watij-session> </testcase>
<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>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
select |
Select the option with the matching displayed text | true | false | boolean | |
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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="name" 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="id" what="textField1" value="some value"/>
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
value |
The text to enter into the text field | false | java.lang.String | ||
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
To get the text field defined by <input type="text" id="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> which exists in a form named 'form1'<watij-text-field functionId="Get the text field with the id'textField1'." how="id" what="textField1" contextVar="textField"/>
See the javadocs on watij's {@link watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.<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"/>
Take a look at this tag's API docs and source code
for more information.
Attribute Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
how |
The way to find the HTML element. See {@link watij.finders.SymbolFactory SymbolFactory} for possible values (i.e. name, id, xpath). | true | java.lang.String | ||
what |
The identifier of the symbol. For example, if symbol is set to | true | java.lang.String | ||
contextVar |
The context variable to store the element in. | htmlElement | true | java.lang.String | |
failOnNotExists |
Fail if the field doesn't exist. | true | false | boolean | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |
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'."/> <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>
<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 Name | Context Name | Description | Default | Required | Type |
---|---|---|---|---|---|
contextVar |
The context variable to store the title in | watijTitle | true | java.lang.String | |
functionId |
The id of this function. This is used in the macro as a short description of the function | true | java.lang.String | ||
breakPoint |
Tells the GUI to stop at this functional point | false | boolean | ||
precondition |
Specifies this is a precondition | false | boolean | ||
postcondition |
Specifies this is a postcondition and will therefore get executed even if a previous functional point or session tag failed. | false | boolean | ||
expectFailure |
Specifies a failure is expected. | false | boolean | ||
expectException |
Specifies an exception is expected. | false | boolean | ||
functionDelay |
The delay time to use at the end of each functional point | -1 | false | long |