| org.ddsteps.web.jwebunit.JWebUnitWebBrowser
All known Subclasses: org.ddsteps.jwebunit.WebBrowser,
JWebUnitWebBrowser | public class JWebUnitWebBrowser extends WebTester implements WebBrowser(Code) | | Extends the WebTester to provide easy-of-use config properties, and a nice
HTML trail functionality.
author: adam version: $Id$ |
Field Summary | |
final public static Log | logger | protected WebTrail | webTrail Dependency / delegate: WebTrail that is used to write trail. |
Method Summary | |
public void | assertButtonDisabled(String buttonId) Assert that a button is present and disabled. | public void | assertButtonEnabled(String buttonId) Assert that a button is present and enabled. | public void | assertFormElementNotPresentOrDisabled(String formElementName) Assert that a form element is not present or disabled. | public void | assertFormElementPresentAndEnabled(String formElementName) Assert that a form element is present and enabled. | public void | assertOptionIsSelectedByValue(String selectId, String selectedValue) | public void | assertOptionValuePresent(String selectId, String value) | public void | assertOptionsEqual(String selectName, String[] expectedOptions) | public void | assertTextInElement(String elementId, String[] texts) If the list has any non blanks strings, the element must exist and have
all the non blank strings in it. | public void | endTrail() | public Button | getButton(String buttonId) | public String | getDefaultOption(String selectName) Gets the LABEL of the selected option in a select box. | public String[] | getOptionValues(String selectId) Get all the option values for a select tag.
Parameters: selectId - The ID of the select tag. | public String | getSelectedOptionValue(String selectName) Gets the LABEL of the selected option in a select box.
Parameters: selectName - The NAME of the select tag. | public File | getTrailFolder() | public boolean | isTrailEnabled() | public void | selectOptionByValue(String selectId, String value) Select an option using the value, not the key. | public void | setFormElement(String formElementName, String[] values) Overload to enable setting multiple form elements with the same name. | public void | setTrailEnabled(boolean trailEnabled) | public void | setTrailFolder(File trailFolder) | public void | setUrl(String url) | public void | setWorkingFormByFieldName(String fieldName) Finds the form with the specified field in, and sets that form as the
working form. | public void | setWorkingFormByFieldNameAndValue(String fieldName, String value) Finds the form with the specified field in with a specific value, and
sets that form as the working form. | public void | startTrail(String trailName) | public void | submit(String buttonName, String value) Push a submit button based on the name and value of it. | protected WebClient | updateDialog() | public void | writePage(String filename) Write the current page to a file, regardless of any current trail or if
trailing is enabled or not. | public void | writeTrail(String pageName) |
logger | final public static Log logger(Code) | | Logger for this class
|
webTrail | protected WebTrail webTrail(Code) | | Dependency / delegate: WebTrail that is used to write trail.
|
JWebUnitWebBrowser | public JWebUnitWebBrowser()(Code) | | No-args. There will be no trail by default.
|
assertButtonDisabled | public void assertButtonDisabled(String buttonId)(Code) | | Assert that a button is present and disabled.
Parameters: buttonId - |
assertButtonEnabled | public void assertButtonEnabled(String buttonId)(Code) | | Assert that a button is present and enabled.
Parameters: buttonId - |
assertFormElementNotPresentOrDisabled | public void assertFormElementNotPresentOrDisabled(String formElementName)(Code) | | Assert that a form element is not present or disabled.
Parameters: formElementName - name of the form element |
assertFormElementPresentAndEnabled | public void assertFormElementPresentAndEnabled(String formElementName)(Code) | | Assert that a form element is present and enabled.
Parameters: formElementName - name of the form element |
assertOptionIsSelectedByValue | public void assertOptionIsSelectedByValue(String selectId, String selectedValue)(Code) | | Parameters: selectId - The select tag. Parameters: selectedValue - The VALUE that should be selected. |
assertOptionValuePresent | public void assertOptionValuePresent(String selectId, String value)(Code) | | Parameters: selectId - Parameters: value - |
assertTextInElement | public void assertTextInElement(String elementId, String[] texts)(Code) | | If the list has any non blanks strings, the element must exist and have
all the non blank strings in it.
Parameters: elementId - Parameters: texts - |
getButton | public Button getButton(String buttonId)(Code) | | Gets a button by id and asserts that is was found
Parameters: buttonId - The button, never null. |
getDefaultOption | public String getDefaultOption(String selectName)(Code) | | Gets the LABEL of the selected option in a select box.
Parameters: selectName - The label |
getOptionValues | public String[] getOptionValues(String selectId)(Code) | | Get all the option values for a select tag.
Parameters: selectId - The ID of the select tag. Array of options. |
getSelectedOptionValue | public String getSelectedOptionValue(String selectName)(Code) | | Gets the LABEL of the selected option in a select box.
Parameters: selectName - The NAME of the select tag. The label |
selectOptionByValue | public void selectOptionByValue(String selectId, String value)(Code) | | Select an option using the value, not the key.
Parameters: selectId - The id of the select tag. Parameters: value - The value |
setFormElement | public void setFormElement(String formElementName, String[] values)(Code) | | Overload to enable setting multiple form elements with the same name.
Parameters: formElementName - name of the form element Parameters: values - the values to set |
setWorkingFormByFieldName | public void setWorkingFormByFieldName(String fieldName)(Code) | | Finds the form with the specified field in, and sets that form as the
working form. The form does not need to have a name or id.
This method does use a bit of evil reflection magic to force itself on
HttpUnit, so you really should concider adding a name or id to your form.
Fails if there are more than one form with that parameter.
Parameters: fieldName - The field name |
setWorkingFormByFieldNameAndValue | public void setWorkingFormByFieldNameAndValue(String fieldName, String value)(Code) | | Finds the form with the specified field in with a specific value, and
sets that form as the working form. The form does not need to have a name
or id. Very useful for choosing between many different forms that differ
only by the value of a hidden field.
This method does use a bit of evil reflection magic to force itself on
HttpUnit, so you really should concider adding a name or id to your form.
It will use the FIRST form it finds with the requested combo.
Parameters: fieldName - The field name Parameters: value - The field value |
submit | public void submit(String buttonName, String value)(Code) | | Push a submit button based on the name and value of it.
Parameters: buttonName - Parameters: value - |
updateDialog | protected WebClient updateDialog()(Code) | | |
writePage | public void writePage(String filename)(Code) | | Write the current page to a file, regardless of any current trail or if
trailing is enabled or not.
If you want a full trail of everything the test sees, use the trail
functionalit instead.
Parameters: filename - Relative filename in the trail folder, or a full file name. |
|
|