public class WebDriverTestingEngineImpl extends Object implements ITestingEngine
Constructor and Description |
---|
WebDriverTestingEngineImpl() |
Modifier and Type | Method and Description |
---|---|
void |
beginAt(URL aInitialURL,
TestContext aTestContext)
Open the browser at an initial URL.
|
void |
checkCheckbox(String checkBoxName)
Select a specified checkbox.
|
void |
checkCheckbox(String checkBoxName,
String checkBoxValue)
Select a specified checkbox.
|
void |
clickButton(String buttonId)
Click the indicated button.
|
void |
clickButtonWithText(String buttonValueText)
Clicks a button with
text of the value attribute. |
void |
clickElementByXPath(String xpath)
Click element with given xpath.
|
void |
clickLink(String anID)
Navigate by submitting a request based on a link with a given ID.
|
void |
clickLinkWithExactText(String linkText,
int index)
Navigate by clicking a link with the exact specified text.
|
void |
clickLinkWithImage(String imageFileName,
int index)
Navigate by submitting a request based on a link with a given image file name.
|
void |
clickLinkWithText(String linkText,
int index)
Navigate by submitting a request based on a link containing the specified text.
|
void |
clickRadioOption(String radioGroup,
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 String |
escapeQuotes(String toEscape)
Copied from
Select |
protected String |
formSelector() |
Map<String,String> |
getAllHeaders()
Get all distinct response headers.
|
List<String> |
getComments()
Get all the comments in a document, as a list of strings.
|
List<javax.servlet.http.Cookie> |
getCookies()
Get all cookies.
|
String |
getElementAttributByXPath(String xpath,
String attribut)
Get attribut value of the given element.
|
IElement |
getElementByID(String id)
Get an element wrapper for a given ID.
|
IElement |
getElementByXPath(String xpath)
Get an element wrapper for a given xpath.
|
List<IElement> |
getElementsByXPath(String xpath)
Get a list of all elements that match the given xpath.
|
String |
getElementTextByXPath(String xpath)
Get text of the given element.
|
String |
getHeader(String name)
Get a particular header or null.
|
String |
getHiddenFieldValue(String paramName)
Return the current value of a hidden input element with name
paramName . |
InputStream |
getInputStream()
Gets the last server response as input stream.
|
InputStream |
getInputStream(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.
|
String |
getPageSource()
Return the source of the current page (like in a browser).
|
String |
getPageText()
Return the string representation of the current page, encoded as specified by the current
TestContext . |
String |
getPageTitle()
Return the page title of the current response page, encoded as specified by the current
TestContext . |
URL |
getPageURL()
Get the location of the current page.
|
List<HttpHeader> |
getResponseHeaders()
Get all response headers.
|
String[] |
getSelectedOptions(String selectName)
Return the values of the currently selected items in a select box.
|
String[] |
getSelectedOptions(String selectName,
int index)
Return the values of the currently selected items in the Nth select box
with the provided name.
|
String |
getSelectedRadio(String radioGroup)
Return the currently selected radio button.
|
String |
getSelectOptionLabelForValue(String selectName,
int index,
String optionValue)
Get the label for a given option of the Nth select box with the
specified name.
|
String |
getSelectOptionLabelForValue(String selectName,
String optionValue)
Get the label for a given option of a select box.
|
String |
getSelectOptionValueForLabel(String selectName,
int index,
String optionLabel)
Get the value for a given option of the Nth select box with
the specified name.
|
String |
getSelectOptionValueForLabel(String selectName,
String optionLabel)
Get the value for a given option of a select box.
|
String[] |
getSelectOptionValues(String selectName)
Return a string array of select box option values.
|
String[] |
getSelectOptionValues(String selectName,
int index)
Return a string array of option values for the Nth select box
with the specified name.
|
String |
getServerResponse()
Return the response of the server for the current page.
|
int |
getServerResponseCode()
Get the request response code.
|
Table |
getTable(String tableSummaryNameOrId)
Each framework have it's own way to represent a Table.
|
String |
getTextFieldValue(String paramName)
Return the current value of a text field with name
paramName . |
int |
getWindowCount()
Get the number of opened Windows.
|
void |
gotoFrame(String frameNameOrId)
Make the frame with the given name or ID active in the current conversation.
|
void |
gotoPage(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(String windowName)
Make the window with the given name active.
|
void |
gotoWindowByTitle(String title)
Goto first window with the given title.
|
boolean |
hasButton(String buttonId)
Checks if a button with
id is present. |
boolean |
hasButtonWithText(String text)
Checks if a button with
text is present. |
boolean |
hasElement(String anID)
Test if element with given id exists.
|
boolean |
hasElementByXPath(String xpath)
Test if element with given xpath exists.
|
boolean |
hasForm()
Check whether the current page contains a form.
|
boolean |
hasForm(String nameOrID)
Return true if the current page contains a specific form.
|
boolean |
hasForm(String nameOrID,
int index)
Return true if the current page contains a specific form.
|
boolean |
hasFormParameterNamed(String paramName)
Return true if a form input element is present on the current form.
|
boolean |
hasFrame(String frameNameOrId)
Test if the given frame is present.
|
boolean |
hasLink(String anId)
Return true if a link is present in the current response with the specified id.
|
boolean |
hasLinkWithExactText(String linkText,
int index)
Return true if a link is present in the current page containing the exact specified text.
|
boolean |
hasLinkWithImage(String imageFileName,
int index)
Return true if a link is present with a given image based on filename of image.
|
boolean |
hasLinkWithText(String linkText,
int index)
Return true if a link is present in the current response containing the specified text.
|
boolean |
hasRadioOption(String radioGroup,
String radioOptionValue)
Checks if a radio group contains the indicated option.
|
boolean |
hasResetButton()
Checks if the current form contains a reset button.
|
boolean |
hasResetButton(String nameOrID)
Checks if the current form contains a specific reset button.
|
boolean |
hasSelectOption(String selectName,
int index,
String optionLabel)
Test if the Nth select box has the given option (by label).
|
boolean |
hasSelectOption(String selectName,
String optionLabel)
Test if a select box has the given option (by label).
|
boolean |
hasSelectOptionValue(String selectName,
int index,
String optionValue)
Test if the Nth select box has the given option (by value).
|
boolean |
hasSelectOptionValue(String selectName,
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(String nameOrID)
Checks if the current form contains a specific submit button.
|
boolean |
hasSubmitButton(String nameOrID,
String value)
Checks if the current form contains a specific submit button.
|
boolean |
hasTable(String tableSummaryNameOrId)
Check if the Table object representing a specified table exists.
|
boolean |
hasWindow(String windowName)
Test if the window with the given name is present.
|
boolean |
hasWindowByTitle(String windowTitle)
Test if window with the given title is present.
|
boolean |
isCheckboxSelected(String checkBoxName)
Determines if the checkbox is selected.
|
boolean |
isCheckboxSelected(String checkBoxName,
String checkBoxValue)
Determines if the checkbox is selected.
|
boolean |
isMatchInElement(String elementID,
String regexp)
Return true if a given regexp is contained within the specified element.
|
boolean |
isTextInElement(String elementID,
String text)
Return true if a given string is contained within the specified element.
|
void |
reset()
Reset the current form with the default reset button.
|
void |
selectOptions(String selectName,
int index,
String[] optionValues)
Select option(s) of the Nth select box by value.
|
void |
selectOptions(String selectName,
String[] optionValues)
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(String inputName,
String text)
Fill hidden field with the provided text.
|
void |
setIgnoreFailingStatusCodes(boolean ignore)
Should the tester ignore failing status codes (300+)?
|
void |
setScriptingEnabled(boolean value)
Enable or disable Javascript support.
|
void |
setTestContext(TestContext testContext) |
void |
setTextField(String inputName,
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(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(String nameOrID)
Submit the current form with the specifed submit button.
|
void |
submit(String buttonName,
String buttonValue)
Submit the current form with the specifed submit button (by name and value).
|
void |
uncheckCheckbox(String checkBoxName)
Deselect a specified checkbox.
|
void |
uncheckCheckbox(String checkBoxName,
String value)
Deselect a specified checkbox.
|
void |
unselectOptions(String selectName,
int index,
String[] optionValues)
Unselect option(s) of the Nth select box with the specified name
by value.
|
void |
unselectOptions(String selectName,
String[] optionValues)
Unselect option(s) of a select box by value.
|
public void beginAt(URL aInitialURL, TestContext aTestContext) throws TestingEngineResponseException
ITestingEngine
beginAt
in interface ITestingEngine
aInitialURL
- Initial URLaTestContext
- Test contextTestingEngineResponseException
- If something bad happend (404)public void setTestContext(TestContext testContext)
public void closeBrowser() throws ExpectedJavascriptAlertException, ExpectedJavascriptConfirmException, ExpectedJavascriptPromptException
ITestingEngine
closeBrowser
in interface ITestingEngine
ExpectedJavascriptAlertException
- If there is pending Javascript alert
ITestingEngine.setExpectedJavaScriptAlert(JavascriptAlert[])
ExpectedJavascriptConfirmException
- If there is pending Javascript confirm
ITestingEngine.setExpectedJavaScriptConfirm(JavascriptConfirm[])
ExpectedJavascriptPromptException
- If there is pending Javascript prompt
ITestingEngine.setExpectedJavaScriptPrompt(JavascriptPrompt[])
public void gotoPage(URL url) throws TestingEngineResponseException
ITestingEngine
gotoPage
in interface ITestingEngine
url
- Full URL of the page.TestingEngineResponseException
- If something bad happend (404)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 List<javax.servlet.http.Cookie> getCookies()
ITestingEngine
getCookies
in interface ITestingEngine
public boolean hasWindow(String windowName)
ITestingEngine
hasWindow
in interface ITestingEngine
windowName
- Name of the window.public boolean hasWindowByTitle(String windowTitle)
ITestingEngine
hasWindowByTitle
in interface ITestingEngine
windowTitle
- Title of the window.public void gotoWindow(String windowName)
ITestingEngine
gotoWindow
in interface ITestingEngine
windowName
- Name of the windowpublic void gotoWindowByTitle(String title)
ITestingEngine
gotoWindowByTitle
in interface ITestingEngine
title
- Title of the windowpublic void gotoWindow(int windowID)
ITestingEngine
gotoWindow
in interface ITestingEngine
windowID
- Javascript ID of the windowpublic void gotoRootWindow()
ITestingEngine
ITestingEngine.gotoFrame(String)
.gotoRootWindow
in interface ITestingEngine
public int getWindowCount()
ITestingEngine
getWindowCount
in interface ITestingEngine
public void closeWindow()
ITestingEngine
closeWindow
in interface ITestingEngine
public boolean hasFrame(String frameNameOrId)
ITestingEngine
hasFrame
in interface ITestingEngine
frameNameOrId
- Name or ID of the frame. ID is checked first.public void gotoFrame(String frameNameOrId)
ITestingEngine
gotoFrame
in interface ITestingEngine
frameNameOrId
- Name or ID of the frame. ID is checked first.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 void setWorkingForm(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.protected String formSelector()
public boolean hasForm()
ITestingEngine
hasForm
in interface ITestingEngine
public boolean hasForm(String nameOrID)
ITestingEngine
hasForm
in interface ITestingEngine
nameOrID
- name of id of the form to check for.public boolean hasForm(String nameOrID, int index)
ITestingEngine
hasForm
in interface ITestingEngine
nameOrID
- name of id of the form to check for.index
- The 0-based index, when more than one form with the same name is expected.public boolean hasFormParameterNamed(String paramName)
ITestingEngine
hasFormParameterNamed
in interface ITestingEngine
paramName
- name of the input element to check forpublic String getTextFieldValue(String paramName)
ITestingEngine
paramName
. Text fields are input text, input
password and textareagetTextFieldValue
in interface ITestingEngine
paramName
- name of the text field element.public String getHiddenFieldValue(String paramName)
ITestingEngine
paramName
.getHiddenFieldValue
in interface ITestingEngine
paramName
- name of the hidden input element.public void setTextField(String inputName, 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(String inputName, String text)
ITestingEngine
setHiddenField
in interface ITestingEngine
inputName
- name of the hidden elementtext
- value to set in the hidden field.public String[] getSelectOptionValues(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 String[] getSelectOptionValues(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 String[] getSelectedOptions(String selectName)
ITestingEngine
getSelectedOptions
in interface ITestingEngine
selectName
- name of the select box.public String[] getSelectedOptions(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 String getSelectOptionLabelForValue(String selectName, String optionValue)
ITestingEngine
getSelectOptionLabelForValue
in interface ITestingEngine
selectName
- name of the select box.optionValue
- label of the option.public String getSelectOptionLabelForValue(String selectName, int index, 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 String getSelectOptionValueForLabel(String selectName, String optionLabel)
ITestingEngine
getSelectOptionValueForLabel
in interface ITestingEngine
selectName
- name of the select box.optionLabel
- label of the option.public String getSelectOptionValueForLabel(String selectName, int index, 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 void selectOptions(String selectName, String[] optionValues)
ITestingEngine
selectOptions
in interface ITestingEngine
selectName
- name of the select box.optionValues
- values of the options to select.public void selectOptions(String selectName, int index, String[] optionValues)
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.optionValues
- values of the options to select.public void unselectOptions(String selectName, String[] optionValues)
ITestingEngine
unselectOptions
in interface ITestingEngine
selectName
- name of the select box.optionValues
- vaules of the options to unselect.public void unselectOptions(String selectName, int index, String[] optionValues)
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.optionValues
- vaules of the options to unselect.public boolean hasSelectOption(String selectName, String optionLabel)
ITestingEngine
hasSelectOption
in interface ITestingEngine
selectName
- name of the select box.optionLabel
- label of the option.public boolean hasSelectOptionValue(String selectName, String optionValue)
ITestingEngine
hasSelectOptionValue
in interface ITestingEngine
selectName
- name of the select box.optionValue
- value of the option.public boolean hasSelectOption(String selectName, int index, 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(String selectName, int index, 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 isCheckboxSelected(String checkBoxName)
ITestingEngine
isCheckboxSelected
in interface ITestingEngine
checkBoxName
- name of the checkbox.public boolean isCheckboxSelected(String checkBoxName, String checkBoxValue)
ITestingEngine
isCheckboxSelected
in interface ITestingEngine
checkBoxName
- name attribut of the checkbox.checkBoxValue
- value attribut of the checkbox.public void checkCheckbox(String checkBoxName)
ITestingEngine
checkCheckbox
in interface ITestingEngine
checkBoxName
- name of checkbox to be selected.public void checkCheckbox(String checkBoxName, String checkBoxValue)
ITestingEngine
checkCheckbox
in interface ITestingEngine
checkBoxName
- name of checkbox to be selected.checkBoxValue
- value of the checkbox (to differenciate checkboxes with the same name).public void uncheckCheckbox(String checkBoxName)
ITestingEngine
uncheckCheckbox
in interface ITestingEngine
checkBoxName
- name of checkbox to be deselected.public void uncheckCheckbox(String checkBoxName, 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 clickRadioOption(String radioGroup, String radioOptionValue)
ITestingEngine
clickRadioOption
in interface ITestingEngine
radioGroup
- name of the radio group.radioOptionValue
- value of the option to check for.public boolean hasRadioOption(String radioGroup, String radioOptionValue)
ITestingEngine
hasRadioOption
in interface ITestingEngine
radioGroup
- name of the radio group.radioOptionValue
- value of the option to check for.public String getSelectedRadio(String radioGroup)
ITestingEngine
getSelectedRadio
in interface ITestingEngine
radioGroup
- name of the radio group.public boolean hasSubmitButton()
ITestingEngine
hasSubmitButton
in interface ITestingEngine
public boolean hasSubmitButton(String nameOrID)
ITestingEngine
hasSubmitButton
in interface ITestingEngine
nameOrID
- name or id of the button to check for.public boolean hasSubmitButton(String nameOrID, String value)
ITestingEngine
hasSubmitButton
in interface ITestingEngine
nameOrID
- name of id of the button to check for.value
- value of the buttonpublic void submit()
ITestingEngine
#getForm
for an explanation of how the
current form is established.submit
in interface ITestingEngine
public void submit(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 submit(String buttonName, String buttonValue)
ITestingEngine
#getForm
for an
explanation of how the current form is established.submit
in interface ITestingEngine
buttonName
- name of the button to use for submission.buttonValue
- value/label of the button to use for submissionpublic boolean hasResetButton()
ITestingEngine
hasResetButton
in interface ITestingEngine
public boolean hasResetButton(String nameOrID)
ITestingEngine
hasResetButton
in interface ITestingEngine
nameOrID
- name or id of the button to check for.public void reset()
ITestingEngine
#getForm
for an explanation of how the current
form is established.reset
in interface ITestingEngine
public boolean hasButtonWithText(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 hasButton(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 void clickButton(String buttonId)
ITestingEngine
clickButton
in interface ITestingEngine
buttonId
- the ID of the button.public void clickButtonWithText(String buttonValueText)
ITestingEngine
text
of the value attribute. clickButtonWithText
in interface ITestingEngine
buttonValueText
- the text of the button (contents of the value attribute).public URL getPageURL()
ITestingEngine
getPageURL
in interface ITestingEngine
public String getPageText()
ITestingEngine
TestContext
.getPageText
in interface ITestingEngine
public String getPageSource()
ITestingEngine
getPageSource
in interface ITestingEngine
public String getPageTitle()
ITestingEngine
TestContext
.getPageTitle
in interface ITestingEngine
public String getServerResponse()
ITestingEngine
getServerResponse
in interface ITestingEngine
public InputStream getInputStream()
ITestingEngine
getInputStream
in interface ITestingEngine
public InputStream getInputStream(URL url) throws TestingEngineResponseException
ITestingEngine
getInputStream
in interface ITestingEngine
url
- the url to the resourceTestingEngineResponseException
public boolean hasTable(String tableSummaryNameOrId)
ITestingEngine
hasTable
in interface ITestingEngine
tableSummaryNameOrId
- summary, name or id of the table.public Table getTable(String tableSummaryNameOrId)
ITestingEngine
getTable
in interface ITestingEngine
tableSummaryNameOrId
- summary, name or id of the table to return.public boolean hasLinkWithText(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 hasLinkWithExactText(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(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 hasLink(String anId)
ITestingEngine
hasLink
in interface ITestingEngine
anId
- link id to check for.public void clickLinkWithText(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 clickLinkWithExactText(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 clickLink(String anID)
ITestingEngine
clickLink
in interface ITestingEngine
anID
- id of link to be navigated.public void clickLinkWithImage(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 boolean hasElement(String anID)
ITestingEngine
hasElement
in interface ITestingEngine
anID
- id of the element.public boolean hasElementByXPath(String xpath)
ITestingEngine
hasElementByXPath
in interface ITestingEngine
xpath
- xpath of the element.public void clickElementByXPath(String xpath)
ITestingEngine
clickElementByXPath
in interface ITestingEngine
xpath
- xpath of the element.public String getElementAttributByXPath(String xpath, String attribut)
ITestingEngine
getElementAttributByXPath
in interface ITestingEngine
xpath
- xpath of the element.attribut
- name of the attribut.public String getElementTextByXPath(String xpath)
ITestingEngine
getElementTextByXPath
in interface ITestingEngine
xpath
- xpath of the element.public boolean isTextInElement(String elementID, String text)
ITestingEngine
isTextInElement
in interface ITestingEngine
elementID
- ID of element to inspect.text
- text to check for.public boolean isMatchInElement(String elementID, String regexp)
ITestingEngine
isMatchInElement
in interface ITestingEngine
elementID
- Id of element to inspect.regexp
- regexp to match.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 IElement getElementByXPath(String xpath)
ITestingEngine
getElementByXPath
in interface ITestingEngine
xpath
- XPath to evaluateITestingEngine.getElementsByXPath(String)
public IElement getElementByID(String id)
ITestingEngine
getElementByID
in interface ITestingEngine
id
- element ID to findpublic List<IElement> getElementsByXPath(String xpath)
ITestingEngine
getElementsByXPath
in interface ITestingEngine
xpath
- XPath to evaluateITestingEngine.getElementByXPath(String)
public int getServerResponseCode()
ITestingEngine
getServerResponseCode
in interface ITestingEngine
public String getHeader(String name)
ITestingEngine
getHeader
in interface ITestingEngine
name
- The header namepublic Map<String,String> getAllHeaders()
ITestingEngine
getAllHeaders
in interface ITestingEngine
public void setIgnoreFailingStatusCodes(boolean ignore)
ITestingEngine
setIgnoreFailingStatusCodes
in interface ITestingEngine
public List<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).public List<HttpHeader> getResponseHeaders()
ITestingEngine
getResponseHeaders
in interface ITestingEngine
HttpHeader
sCopyright © 2002-2015 JWebUnit. All Rights Reserved.