|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jwebunit.selenium.SeleniumTestingEngineImpl
public class SeleniumTestingEngineImpl
Acts as the wrapper for Selenium access. A testing engine is initialized with a given URL, and maintains conversational state as the dialog progresses through link navigation, form submission, etc.
Constructor Summary | |
---|---|
SeleniumTestingEngineImpl()
|
Method Summary | |
---|---|
void |
beginAt(java.net.URL aInitialURL,
TestContext aTestContext)
Open the browser at an initial URL. |
void |
checkCheckbox(java.lang.String checkBoxName)
Select a specified checkbox. |
void |
checkCheckbox(java.lang.String checkBoxName,
java.lang.String value)
Select a specified checkbox. |
void |
clickButton(java.lang.String buttonId)
Click the indicated button. |
void |
clickButtonWithText(java.lang.String buttonValueText)
Clicks a button with text of the value attribute. |
void |
clickElementByXPath(java.lang.String xpath)
Click element with given xpath. |
void |
clickLink(java.lang.String anID)
Navigate by submitting a request based on a link with a given ID. |
void |
clickLinkWithExactText(java.lang.String linkText,
int index)
Navigate by clicking a link with the exact specified text. |
void |
clickLinkWithImage(java.lang.String imageFileName,
int index)
Navigate by submitting a request based on a link with a given image file name. |
void |
clickLinkWithText(java.lang.String linkText,
int index)
Navigate by submitting a request based on a link containing the specified text. |
void |
clickRadioOption(java.lang.String radioGroup,
java.lang.String radioOptionValue)
Clicks a radio option. |
void |
closeBrowser()
Close the browser and check if there is no pending Javascript alert, confirm or prompt. |
void |
closeWindow()
Close the current window. |
protected java.lang.String |
formSelector()
|
java.util.Map<java.lang.String,java.lang.String> |
getAllHeaders()
Get all headers. |
java.util.List<java.lang.String> |
getComments()
Get all the comments in a document, as a list of strings. |
java.util.List |
getCookies()
Get all cookies. |
java.lang.String |
getElementAttributByXPath(java.lang.String xpath,
java.lang.String attribut)
Get attribut value of the given element. |
IElement |
getElementByID(java.lang.String id)
Get an element wrapper for a given ID. |
IElement |
getElementByXPath(java.lang.String xpath)
Get an element wrapper for a given xpath. |
java.util.List<IElement> |
getElementsByXPath(java.lang.String xpath)
Get a list of all elements that match the given xpath. |
java.lang.String |
getElementTextByXPath(java.lang.String xpath)
Get text of the given element. |
java.lang.String |
getHeader(java.lang.String name)
Get a particular header or null. |
java.lang.String |
getHiddenFieldValue(java.lang.String paramName)
Return the current value of a hidden input element with name paramName . |
java.io.InputStream |
getInputStream()
Gets the last server response as input stream. |
java.io.InputStream |
getInputStream(java.net.URL url)
Gets the input stream for a given URL - can be used to test images or other resources without changing the current navigation context. |
java.lang.String |
getJavascriptAlert()
|
java.lang.String |
getPageSource()
Return the source of the current page (like in a browser). |
java.lang.String |
getPageText()
Return the string representation of the current page, encoded as specified by the current TestContext . |
java.lang.String |
getPageTitle()
Return the page title of the current response page, encoded as specified by the current TestContext . |
java.net.URL |
getPageURL()
Get the location of the current page. |
protected int |
getRadioCount(java.lang.String radioGroup)
|
java.lang.String[] |
getSelectedOptions(java.lang.String selectName)
Return the values of the currently selected items in a select box. |
java.lang.String[] |
getSelectedOptions(java.lang.String selectName,
int index)
Return the values of the currently selected items in the Nth select box with the provided name. |
java.lang.String |
getSelectedRadio(java.lang.String radioGroup)
Return the currently selected radio button. |
java.lang.String |
getSelectOptionLabelForValue(java.lang.String selectName,
int index,
java.lang.String optionValue)
Get the label for a given option of the Nth select box with the specified name. |
java.lang.String |
getSelectOptionLabelForValue(java.lang.String selectName,
java.lang.String optionValue)
Get the label for a given option of a select box. |
java.lang.String |
getSelectOptionValueForLabel(java.lang.String selectName,
int index,
java.lang.String optionLabel)
Get the value for a given option of the Nth select box with the specified name. |
java.lang.String |
getSelectOptionValueForLabel(java.lang.String selectName,
java.lang.String optionLabel)
Get the value for a given option of a select box. |
java.lang.String[] |
getSelectOptionValues(java.lang.String selectName)
Return a string array of select box option values. |
java.lang.String[] |
getSelectOptionValues(java.lang.String selectName,
int index)
Return a string array of option values for the Nth select box with the specified name. |
java.lang.String |
getServerResponse()
Return the response of the server for the current page. |
int |
getServerResponseCode()
Get the request response code. |
Table |
getTable(java.lang.String tableSummaryNameOrId)
Each framework have it's own way to represent a Table. |
TestContext |
getTestContext()
|
java.lang.String |
getTextFieldValue(java.lang.String paramName)
Return the current value of a text field with name paramName . |
int |
getWindowCount()
Get the number of openend Windows. |
void |
goBack()
|
void |
gotoFrame(java.lang.String frameName)
Make the frame with the given name or ID active in the current conversation. |
void |
gotoPage(java.net.URL url)
Simulate user typing a new URL in the browser. |
void |
gotoRootWindow()
Make the root window active. |
void |
gotoWindow(int windowID)
Goto window with the given Javascript ID. |
void |
gotoWindow(java.lang.String windowName)
Make the window with the given name active. |
void |
gotoWindowByTitle(java.lang.String title)
Goto first window with the given title. |
boolean |
hasButton(java.lang.String buttonId)
Checks if a button with id is present.A button can be the following HTML elements: input type=button button type=button |
boolean |
hasButtonWithText(java.lang.String text)
Checks if a button with text is present.A button can be the following HTML elements: input type=button button type=button |
boolean |
hasDomComment(java.lang.String comment)
|
boolean |
hasElement(java.lang.String anID)
Test if element with given id exists. |
boolean |
hasElementByXPath(java.lang.String xpath)
Test if element with given xpath exists. |
boolean |
hasForm()
Check whether the current page contains a form. |
boolean |
hasForm(java.lang.String nameOrID)
Return true if the current page contains a specific form. |
boolean |
hasFormParameterNamed(java.lang.String paramName)
Return true if a form input element is present on the current form. |
boolean |
hasFrame(java.lang.String frameName)
Test if the given frame is present. |
boolean |
hasLink(java.lang.String anId)
Return true if a link is present in the current response with the specified id. |
boolean |
hasLinkWithExactText(java.lang.String linkText,
int index)
Return true if a link is present in the current page containing the exact specified text. |
boolean |
hasLinkWithImage(java.lang.String imageFileName,
int index)
Return true if a link is present with a given image based on filename of image. |
boolean |
hasLinkWithText(java.lang.String linkText,
int index)
Return true if a link is present in the current response containing the specified text. |
boolean |
hasRadioOption(java.lang.String radioGroup,
java.lang.String radioOptionValue)
Checks if a radio group contains the indicated option. |
boolean |
hasResetButton()
Checks if the current form contains a reset button. A reset button can be the following HTML elements: input type=reset button type=reset |
boolean |
hasResetButton(java.lang.String nameOrID)
Checks if the current form contains a specific reset button. A reset button can be the following HTML elements: input type=reset button type=reset |
boolean |
hasSelectOption(java.lang.String selectName,
int index,
java.lang.String optionLabel)
Test if the Nth select box has the given option (by label). |
boolean |
hasSelectOption(java.lang.String selectName,
java.lang.String optionLabel)
Test if a select box has the given option (by label). |
boolean |
hasSelectOptionValue(java.lang.String selectName,
int index,
java.lang.String optionValue)
Test if the Nth select box has the given option (by value). |
boolean |
hasSelectOptionValue(java.lang.String selectName,
java.lang.String optionValue)
Test if a select box has the given option (by value). |
boolean |
hasSubmitButton()
Checks if the current form contains a submit button. |
boolean |
hasSubmitButton(java.lang.String nameOrID)
Checks if the current form contains a specific submit button. A submit button can be the following HTML elements: input type=submit input type=image button type=submit |
boolean |
hasSubmitButton(java.lang.String nameOrID,
java.lang.String value)
Checks if the current form contains a specific submit button. A submit button can be the following HTML elements: input type=submit input type=image button type=submit |
boolean |
hasTable(java.lang.String tableSummaryNameOrId)
Check if the Table object representing a specified table exists. |
boolean |
hasWindow(java.lang.String windowName)
Test if the window with the given name is present. |
boolean |
hasWindowByTitle(java.lang.String title)
Test if window with the given title is present. |
boolean |
isCheckboxSelected(java.lang.String checkBoxName)
Determines if the checkbox is selected. |
boolean |
isCheckboxSelected(java.lang.String checkBoxName,
java.lang.String checkBoxValue)
Determines if the checkbox is selected. |
boolean |
isMatchInElement(java.lang.String elementID,
java.lang.String regexp)
Return true if a given regexp is contained within the specified element. |
boolean |
isTextInElement(java.lang.String elementID,
java.lang.String text)
Return true if a given string is contained within the specified element. |
void |
refresh()
|
void |
reset()
Reset the current form with the default reset button. |
void |
selectOptions(java.lang.String selectName,
int index,
java.lang.String[] optionsValue)
Select option(s) of the Nth select box by value. |
void |
selectOptions(java.lang.String selectName,
java.lang.String[] optionsValue)
Select option(s) of a select box by value. |
void |
setExpectedJavaScriptAlert(JavascriptAlert[] alerts)
Tell the testing engine that the given alert boxes are expected in the given order. |
void |
setExpectedJavaScriptConfirm(JavascriptConfirm[] confirms)
Tell the testing engine that the given confirm boxes are expected in the given order. |
void |
setExpectedJavaScriptPrompt(JavascriptPrompt[] prompts)
Tell the testing engine that the given prompt boxes are expected in the given order. |
void |
setHiddenField(java.lang.String inputName,
java.lang.String text)
Fill hidden field with the provided text. |
void |
setIgnoreFailingStatusCodes(boolean ignore)
Should the tester ignore failing status codes (300+)? Otherwise, failing status codes will throw an exception. |
void |
setScriptingEnabled(boolean value)
Enable or disable Javascript support. |
void |
setTestContext(TestContext testContext)
|
void |
setTextField(java.lang.String inputName,
java.lang.String text)
Fill a text, password or textarea field with the provided text. |
void |
setThrowExceptionOnScriptError(boolean value)
Set whether or not to throw an exception on Javascript errors. |
void |
setTimeout(int milliseconds)
Set the timeout for the request. |
void |
setWorkingForm(int index)
Set the form on the current page that the client wishes to work with explicitly by index in the page. |
void |
setWorkingForm(java.lang.String nameOrId,
int index)
Set the form on the current page that the client wishes to work with explicitly by either the form name or id (match by id is attempted first). |
void |
submit()
Submit the current form with the default submit button. |
void |
submit(java.lang.String nameOrID)
Submit the current form with the specifed submit button. |
void |
submit(java.lang.String nameOrID,
java.lang.String value)
Submit the current form with the specifed submit button (by name and value). |
void |
uncheckCheckbox(java.lang.String checkBoxName)
Deselect a specified checkbox. |
void |
uncheckCheckbox(java.lang.String checkBoxName,
java.lang.String value)
Deselect a specified checkbox. |
void |
unselectOptions(java.lang.String selectName,
int index,
java.lang.String[] options)
Unselect option(s) of the Nth select box with the specified name by value. |
void |
unselectOptions(java.lang.String selectName,
java.lang.String[] options)
Unselect option(s) of a select box by value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SeleniumTestingEngineImpl()
Method Detail |
---|
public void beginAt(java.net.URL aInitialURL, TestContext aTestContext) throws TestingEngineResponseException
ITestingEngine
beginAt
in interface ITestingEngine
aInitialURL
- Initial URLaTestContext
- Test context
TestingEngineResponseException
- If something bad happend (404)public void checkCheckbox(java.lang.String checkBoxName, java.lang.String value)
ITestingEngine
checkCheckbox
in interface ITestingEngine
checkBoxName
- name of checkbox to be selected.value
- value of the checkbox (to differenciate checkboxes with the same name).public void checkCheckbox(java.lang.String checkBoxName)
ITestingEngine
checkCheckbox
in interface ITestingEngine
checkBoxName
- name of checkbox to be selected.public void clickButton(java.lang.String buttonId)
ITestingEngine
clickButton
in interface ITestingEngine
buttonId
- the ID of the button.public void clickButtonWithText(java.lang.String buttonValueText)
ITestingEngine
text
of the value attribute.
clickButtonWithText
in interface ITestingEngine
buttonValueText
- the text of the button (contents of the value attribute).public void clickElementByXPath(java.lang.String xpath)
ITestingEngine
clickElementByXPath
in interface ITestingEngine
xpath
- xpath of the element.public void clickLink(java.lang.String anID)
ITestingEngine
clickLink
in interface ITestingEngine
anID
- id of link to be navigated.public void clickLinkWithExactText(java.lang.String linkText, int index)
ITestingEngine
clickLinkWithExactText
in interface ITestingEngine
linkText
- exact text which link to be navigated should contain.index
- The 0-based index, when more than one link with the same text is expected.public void clickLinkWithImage(java.lang.String imageFileName, int index)
ITestingEngine
clickLinkWithImage
in interface ITestingEngine
imageFileName
- A suffix of the image's filename; for example, to match "images/my_icon.png",
you could just pass in "my_icon.png".index
- The 0-based index, when more than one link with the same text is expected.public void clickLinkWithText(java.lang.String linkText, int index)
ITestingEngine
clickLinkWithText
in interface ITestingEngine
linkText
- text which link to be navigated should contain.index
- The 0-based index, when more than one link with the same text is expected.public void clickRadioOption(java.lang.String radioGroup, java.lang.String radioOptionValue)
ITestingEngine
clickRadioOption
in interface ITestingEngine
radioGroup
- name of the radio group.radioOptionValue
- value of the option to check for.public void closeBrowser() throws TestingEngineResponseException
ITestingEngine
closeBrowser
in interface ITestingEngine
TestingEngineResponseException
public void closeWindow()
ITestingEngine
closeWindow
in interface ITestingEngine
public java.lang.String getPageSource()
ITestingEngine
getPageSource
in interface ITestingEngine
public java.lang.String getPageText()
ITestingEngine
TestContext
.
getPageText
in interface ITestingEngine
public java.lang.String getPageTitle()
ITestingEngine
TestContext
.
getPageTitle
in interface ITestingEngine
public java.util.List getCookies()
ITestingEngine
getCookies
in interface ITestingEngine
public java.lang.String[] getSelectedOptions(java.lang.String selectName)
ITestingEngine
getSelectedOptions
in interface ITestingEngine
selectName
- name of the select box.public java.lang.String getSelectOptionLabelForValue(java.lang.String selectName, java.lang.String optionValue)
ITestingEngine
getSelectOptionLabelForValue
in interface ITestingEngine
selectName
- name of the select box.optionValue
- label of the option.public java.lang.String getSelectOptionValueForLabel(java.lang.String selectName, java.lang.String optionLabel)
ITestingEngine
getSelectOptionValueForLabel
in interface ITestingEngine
selectName
- name of the select box.optionLabel
- label of the option.public java.lang.String[] getSelectOptionValues(java.lang.String selectName)
ITestingEngine
Should return [Component_1_a, Component_1_b, Component_3, Component_4, Component_5]
getSelectOptionValues
in interface ITestingEngine
selectName
- name of the select box.
public java.lang.String[] getSelectedOptions(java.lang.String selectName, int index)
ITestingEngine
getSelectedOptions
in interface ITestingEngine
selectName
- name of the select box.index
- the 0-based index used when more than one select with
the same name is expected.public java.lang.String getSelectOptionLabelForValue(java.lang.String selectName, int index, java.lang.String optionValue)
ITestingEngine
getSelectOptionLabelForValue
in interface ITestingEngine
selectName
- name of the select box.index
- the 0-based index used when more than one select with
the same name is expected.optionValue
- label of the option.public java.lang.String getSelectOptionValueForLabel(java.lang.String selectName, int index, java.lang.String optionLabel)
ITestingEngine
getSelectOptionValueForLabel
in interface ITestingEngine
selectName
- name of the select box.index
- the 0-based index used when more than one select with
the same name is expected.optionLabel
- label of the option.public java.lang.String[] getSelectOptionValues(java.lang.String selectName, int index)
ITestingEngine
getSelectOptionValues
in interface ITestingEngine
selectName
- name of the select box.index
- the 0-based index used when more than one select with
the same name is expected.
public java.lang.String getServerResponse()
ITestingEngine
getServerResponse
in interface ITestingEngine
public void goBack()
public void gotoFrame(java.lang.String frameName)
ITestingEngine
gotoFrame
in interface ITestingEngine
frameName
- Name or ID of the frame. ID is checked first.public void gotoPage(java.net.URL url) throws TestingEngineResponseException
ITestingEngine
gotoPage
in interface ITestingEngine
url
- Full URL of the page.
TestingEngineResponseException
- If something bad happend (404)public void gotoRootWindow()
ITestingEngine
gotoRootWindow
in interface ITestingEngine
public void gotoWindow(java.lang.String windowName)
ITestingEngine
gotoWindow
in interface ITestingEngine
windowName
- Name of the windowpublic void gotoWindowByTitle(java.lang.String title)
ITestingEngine
gotoWindowByTitle
in interface ITestingEngine
title
- Title of the windowpublic boolean hasButton(java.lang.String buttonId)
ITestingEngine
id
is present.
hasButton
in interface ITestingEngine
buttonId
- the ID of the button.
true
when the button with text could be found.public boolean hasButtonWithText(java.lang.String text)
ITestingEngine
text
is present.
hasButtonWithText
in interface ITestingEngine
text
- the text of the button (contents of the value attribute).
true
when the button with text could be found.public boolean hasElement(java.lang.String anID)
ITestingEngine
hasElement
in interface ITestingEngine
anID
- id of the element.
public boolean hasElementByXPath(java.lang.String xpath)
ITestingEngine
hasElementByXPath
in interface ITestingEngine
xpath
- xpath of the element.
public boolean hasForm()
ITestingEngine
hasForm
in interface ITestingEngine
public boolean hasForm(java.lang.String nameOrID)
ITestingEngine
hasForm
in interface ITestingEngine
nameOrID
- name of id of the form to check for.
public boolean hasFormParameterNamed(java.lang.String paramName)
ITestingEngine
hasFormParameterNamed
in interface ITestingEngine
paramName
- name of the input element to check for
public boolean hasFrame(java.lang.String frameName)
ITestingEngine
hasFrame
in interface ITestingEngine
frameName
- Name or ID of the frame. ID is checked first.
public boolean hasLink(java.lang.String anId)
ITestingEngine
hasLink
in interface ITestingEngine
anId
- link id to check for.public boolean hasLinkWithExactText(java.lang.String linkText, int index)
ITestingEngine
hasLinkWithExactText
in interface ITestingEngine
linkText
- text to check for in links on the response.index
- The 0-based index, when more than one link with the same text is expected.public boolean hasLinkWithImage(java.lang.String imageFileName, int index)
ITestingEngine
hasLinkWithImage
in interface ITestingEngine
imageFileName
- A suffix of the image's filename; for example, to match
"images/my_icon.png", you could just pass in
"my_icon.png".index
- The 0-based index, when more than one link with the same text
is expected.public boolean hasLinkWithText(java.lang.String linkText, int index)
ITestingEngine
hasLinkWithText
in interface ITestingEngine
linkText
- text to check for in links on the response.index
- The 0-based index, when more than one link with the same text is expected.public boolean hasRadioOption(java.lang.String radioGroup, java.lang.String radioOptionValue)
ITestingEngine
hasRadioOption
in interface ITestingEngine
radioGroup
- name of the radio group.radioOptionValue
- value of the option to check for.public boolean hasSelectOption(java.lang.String selectName, java.lang.String optionLabel)
ITestingEngine
hasSelectOption
in interface ITestingEngine
selectName
- name of the select box.optionLabel
- label of the option.
public boolean hasSelectOptionValue(java.lang.String selectName, java.lang.String optionValue)
ITestingEngine
hasSelectOptionValue
in interface ITestingEngine
selectName
- name of the select box.optionValue
- value of the option.
public boolean hasSelectOption(java.lang.String selectName, int index, java.lang.String optionLabel)
ITestingEngine
hasSelectOption
in interface ITestingEngine
selectName
- name of the select box.index
- the 0-based index of the select element when multiple
select elements are expected.optionLabel
- label of the option.
public boolean hasSelectOptionValue(java.lang.String selectName, int index, java.lang.String optionValue)
ITestingEngine
hasSelectOptionValue
in interface ITestingEngine
selectName
- name of the select box.index
- the 0-based index of the select element when multiple
select elements are expected.optionValue
- value of the option.
public boolean hasSubmitButton()
ITestingEngine
hasSubmitButton
in interface ITestingEngine
public boolean hasSubmitButton(java.lang.String nameOrID, java.lang.String value)
ITestingEngine
hasSubmitButton
in interface ITestingEngine
nameOrID
- name of id of the button to check for.value
- value of the buttonpublic boolean hasSubmitButton(java.lang.String nameOrID)
ITestingEngine
hasSubmitButton
in interface ITestingEngine
nameOrID
- name or id of the button to check for.public boolean hasResetButton()
ITestingEngine
hasResetButton
in interface ITestingEngine
public boolean hasResetButton(java.lang.String nameOrID)
ITestingEngine
hasResetButton
in interface ITestingEngine
nameOrID
- name or id of the button to check for.public boolean hasTable(java.lang.String tableSummaryNameOrId)
ITestingEngine
hasTable
in interface ITestingEngine
tableSummaryNameOrId
- summary, name or id of the table.
public boolean hasWindow(java.lang.String windowName)
ITestingEngine
hasWindow
in interface ITestingEngine
windowName
- Name of the window.
public boolean hasWindowByTitle(java.lang.String title)
ITestingEngine
hasWindowByTitle
in interface ITestingEngine
title
- Title of the window.
public boolean isCheckboxSelected(java.lang.String checkBoxName)
ITestingEngine
isCheckboxSelected
in interface ITestingEngine
checkBoxName
- name of the checkbox.
public boolean isCheckboxSelected(java.lang.String checkBoxName, java.lang.String checkBoxValue)
ITestingEngine
isCheckboxSelected
in interface ITestingEngine
checkBoxName
- name attribut of the checkbox.checkBoxValue
- value attribut of the checkbox.
public boolean isMatchInElement(java.lang.String elementID, java.lang.String regexp)
ITestingEngine
isMatchInElement
in interface ITestingEngine
elementID
- Id of element to inspect.regexp
- regexp to match.
public boolean isTextInElement(java.lang.String elementID, java.lang.String text)
ITestingEngine
isTextInElement
in interface ITestingEngine
elementID
- ID of element to inspect.text
- text to check for.
public void refresh()
public void reset()
ITestingEngine
#getForm
for an explanation of how the current
form is established.
reset
in interface ITestingEngine
public void selectOptions(java.lang.String selectName, java.lang.String[] optionsValue)
ITestingEngine
selectOptions
in interface ITestingEngine
selectName
- name of the select box.optionsValue
- values of the options to select.public void selectOptions(java.lang.String selectName, int index, java.lang.String[] optionsValue)
ITestingEngine
selectOptions
in interface ITestingEngine
selectName
- name of the select box.index
- the 0-based index of the select element when multiple
select elements are expected.optionsValue
- values of the options to select.public void setScriptingEnabled(boolean value)
ITestingEngine
setScriptingEnabled
in interface ITestingEngine
value
- true to enable Javascript.public void setThrowExceptionOnScriptError(boolean value)
ITestingEngine
setThrowExceptionOnScriptError
in interface ITestingEngine
value
- true to throw an exception on Javascript errors.public void setTextField(java.lang.String inputName, java.lang.String text)
ITestingEngine
setTextField
in interface ITestingEngine
inputName
- name of the text, password or textarea elementtext
- value to type in the field.public void setHiddenField(java.lang.String inputName, java.lang.String text)
ITestingEngine
setHiddenField
in interface ITestingEngine
inputName
- name of the hidden elementtext
- value to set in the hidden field.public void setWorkingForm(java.lang.String nameOrId, int index)
ITestingEngine
setWorkingForm
in interface ITestingEngine
nameOrId
- name or id of the form to be worked with.index
- The 0-based index, when more than one form with the same name is expected.public void submit()
ITestingEngine
#getForm
for an explanation of how the
current form is established.
submit
in interface ITestingEngine
public void submit(java.lang.String nameOrID, java.lang.String value)
ITestingEngine
#getForm
for an
explanation of how the current form is established.
submit
in interface ITestingEngine
nameOrID
- name of the button to use for submission.value
- value/label of the button to use for submissionpublic void submit(java.lang.String nameOrID)
ITestingEngine
#getForm
for an explanation of how the
current form is established.
submit
in interface ITestingEngine
nameOrID
- name of the button to use for submission.public void uncheckCheckbox(java.lang.String checkBoxName, java.lang.String value)
ITestingEngine
uncheckCheckbox
in interface ITestingEngine
checkBoxName
- name of checkbox to be deselected.value
- value of the checkbox (to differenciate checkboxes with the same name).public void uncheckCheckbox(java.lang.String checkBoxName)
ITestingEngine
uncheckCheckbox
in interface ITestingEngine
checkBoxName
- name of checkbox to be deselected.public void unselectOptions(java.lang.String selectName, java.lang.String[] options)
ITestingEngine
unselectOptions
in interface ITestingEngine
selectName
- name of the select box.options
- vaules of the options to unselect.public void unselectOptions(java.lang.String selectName, int index, java.lang.String[] options)
ITestingEngine
unselectOptions
in interface ITestingEngine
selectName
- name of the select box.index
- the 0-based index of the select element when multiple
select elements are expected.options
- vaules of the options to unselect.public TestContext getTestContext()
public void setTestContext(TestContext testContext)
public Table getTable(java.lang.String tableSummaryNameOrId)
ITestingEngine
getTable
in interface ITestingEngine
tableSummaryNameOrId
- summary, name or id of the table to return.
protected java.lang.String formSelector()
public int getWindowCount()
ITestingEngine
getWindowCount
in interface ITestingEngine
public void gotoWindow(int windowID)
ITestingEngine
gotoWindow
in interface ITestingEngine
windowID
- Javascript ID of the windowpublic java.lang.String getTextFieldValue(java.lang.String paramName)
ITestingEngine
paramName
. Text fields are input text, input
password and textarea
getTextFieldValue
in interface ITestingEngine
paramName
- name of the text field element.
public java.lang.String getHiddenFieldValue(java.lang.String paramName)
ITestingEngine
paramName
.
getHiddenFieldValue
in interface ITestingEngine
paramName
- name of the hidden input element.
public java.lang.String getJavascriptAlert() throws ElementNotFoundException
ElementNotFoundException
public java.lang.String getElementAttributByXPath(java.lang.String xpath, java.lang.String attribut)
ITestingEngine
getElementAttributByXPath
in interface ITestingEngine
xpath
- xpath of the element.attribut
- name of the attribut.
public java.lang.String getElementTextByXPath(java.lang.String xpath)
ITestingEngine
getElementTextByXPath
in interface ITestingEngine
xpath
- xpath of the element.public java.io.InputStream getInputStream()
ITestingEngine
getInputStream
in interface ITestingEngine
public java.io.InputStream getInputStream(java.net.URL url) throws TestingEngineResponseException
ITestingEngine
getInputStream
in interface ITestingEngine
url
- the url to the resource
TestingEngineResponseException
public java.net.URL getPageURL()
ITestingEngine
getPageURL
in interface ITestingEngine
public java.lang.String getSelectedRadio(java.lang.String radioGroup)
ITestingEngine
getSelectedRadio
in interface ITestingEngine
radioGroup
- name of the radio group.
protected int getRadioCount(java.lang.String radioGroup)
public void setExpectedJavaScriptAlert(JavascriptAlert[] alerts) throws ExpectedJavascriptAlertException
ITestingEngine
setExpectedJavaScriptAlert
in interface ITestingEngine
alerts
- Expected alerts.
ExpectedJavascriptAlertException
- If there are still unconsummed alert since a previous call of this
method.public void setExpectedJavaScriptConfirm(JavascriptConfirm[] confirms) throws ExpectedJavascriptConfirmException
ITestingEngine
setExpectedJavaScriptConfirm
in interface ITestingEngine
confirms
- Expected confirms.
ExpectedJavascriptConfirmException
- If there are still unconsummed confirm since a previous call of this
method.public void setExpectedJavaScriptPrompt(JavascriptPrompt[] prompts) throws ExpectedJavascriptPromptException
ITestingEngine
setExpectedJavaScriptPrompt
in interface ITestingEngine
prompts
- Expected prompts.
ExpectedJavascriptPromptException
- If there are still unconsummed prompt since a previous call of this
method.public void setWorkingForm(int index)
ITestingEngine
setWorkingForm
in interface ITestingEngine
index
- The 0-based index, when more than one form with the same name is expected.public IElement getElementByXPath(java.lang.String xpath)
ITestingEngine
getElementByXPath
in interface ITestingEngine
xpath
- XPath to evaluate
ITestingEngine.getElementsByXPath(String)
public IElement getElementByID(java.lang.String id)
ITestingEngine
getElementByID
in interface ITestingEngine
id
- element ID to find
public java.util.List<IElement> getElementsByXPath(java.lang.String xpath)
ITestingEngine
getElementsByXPath
in interface ITestingEngine
xpath
- XPath to evaluate
ITestingEngine.getElementByXPath(String)
public int getServerResponseCode()
ITestingEngine
getServerResponseCode
in interface ITestingEngine
public java.util.Map<java.lang.String,java.lang.String> getAllHeaders()
ITestingEngine
getAllHeaders
in interface ITestingEngine
public java.lang.String getHeader(java.lang.String name)
ITestingEngine
getHeader
in interface ITestingEngine
name
- The header name
public void setIgnoreFailingStatusCodes(boolean ignore)
ITestingEngine
setIgnoreFailingStatusCodes
in interface ITestingEngine
public boolean hasDomComment(java.lang.String comment)
public java.util.List<java.lang.String> getComments()
ITestingEngine
getComments
in interface ITestingEngine
public void setTimeout(int milliseconds)
ITestingEngine
setTimeout
in interface ITestingEngine
milliseconds
- the milliseconds in which to timeout, or 0 for infinite
wait (the default).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |