Class AbstractHtmlUnitCommandsModule
java.lang.Object
com.xceptance.xlt.api.engine.scripting.AbstractHtmlUnitScriptModule
com.xceptance.xlt.api.engine.scripting.AbstractHtmlUnitCommandsModule
Base class of all command modules.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HtmlPageaddSelection(String select, String option) Adds the given option of the given select to the current selection.protected voidassertAttribute(String attributeLocator, String textPattern) Asserts that the value of the attribute identified by the given attribute locator matches the given text pattern.protected voidassertAttribute(String elementLocator, String attributeName, String textPattern) Asserts that the value of the attribute identified by the given element locator and attribute name matches the given text pattern.protected voidassertChecked(String elementLocator) Asserts that the given checkbox/radio button is checked.protected voidassertClass(String elementLocator, String clazzString) Asserts that the given element has the given class(es).protected voidassertElementCount(String elementLocator, int count) Asserts that the number of elements found by using the given element locator is equal to the given count.protected voidassertElementCount(String elementLocator, String count) Asserts that the number of elements found by using the given element locator is equal to the given count.protected voidassertElementPresent(String elementLocator) Asserts that the given element is present.protected voidassertEval(String expression, String textPattern) Asserts that evaluating the given expression matches the given text pattern.protected voidassertLoadTime(long loadTime) Asserts that the time needed to load a page does not exceed the given value.protected voidassertLoadTime(String loadTime) Asserts that the time needed to load a page does not exceed the given value.protected voidassertNotAttribute(String attributeLocator, String textPattern) Asserts that the value of the attribute identified by the given attribute locator does NOT match the given text pattern.protected voidassertNotAttribute(String elementLocator, String attributeName, String textPattern) Asserts that the value of the attribute identified by the given element locator and attribute name does NOT match the given text pattern.protected voidassertNotChecked(String elementLocator) Asserts that the given checkbox/radio button is unchecked.protected voidassertNotClass(String elementLocator, String clazzString) Asserts that the given element doesn't have the given class(es).protected voidassertNotElementCount(String elementLocator, int count) Asserts that the number of elements found by using the given element locator is unequal to the given count.protected voidassertNotElementCount(String elementLocator, String count) Asserts that the number of elements found by using the given element locator is unequal to the given count.protected voidassertNotElementPresent(String elementLocator) Asserts that the given element is not present.protected voidassertNotEval(String expression, String textPattern) Asserts that evaluating the given expression does NOT match the given text pattern.protected voidassertNotSelectedId(String selectLocator, String idPattern) Asserts that no ID of all selected options of the given select element matches the given pattern.protected voidassertNotSelectedIndex(String selectLocator, String indexPattern) Asserts that the option of the given select element at the given index is not selected.protected voidassertNotSelectedLabel(String selectLocator, String labelPattern) Asserts that no label of all selected options of the given select element matches the given pattern.protected voidassertNotSelectedValue(String selectLocator, String valuePattern) Asserts that no value of all selected options of the given select element matches the given pattern.protected voidassertNotStyle(String elementLocator, String styleText) Asserts that the effective style of the element identified by the given element locator does NOT match the given style.protected voidassertNotText(String elementLocator, String text) Asserts that the embedded text of the given element does not contain the given text.protected voidassertNotTextPresent(String text) Asserts that the given text is not present on the page.protected voidassertNotTitle(String title) Asserts that the page title does not match the given title.protected voidassertNotValue(String elementLocator, String valuePattern) Asserts that the value of the given element doesn't match the given value.protected voidassertNotVisible(String elementLocator) Asserts that the given element is invisible.protected voidassertNotXpathCount(String xpath, int count) Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.protected voidassertNotXpathCount(String xpath, String count) Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.protected voidassertPageSize(long pageSize) Asserts that the size of the actual page (including images etc.) does not exceed the given value.protected voidassertPageSize(String pageSize) Asserts that the size of the actual page (including images etc.) does not exceed the given value.protected voidassertSelectedId(String selectLocator, String idPattern) Asserts that the ID of at least one selected option of the given select element matches the given pattern.protected voidassertSelectedIndex(String selectLocator, String indexPattern) Asserts that the option of the given select element at the given index is selected.protected voidassertSelectedLabel(String selectLocator, String labelPattern) Asserts that the label of at least one selected option of the given select element matches the given pattern.protected voidassertSelectedValue(String selectLocator, String valuePattern) Asserts that the value of at least one selected option of the given select element matches the given pattern.protected voidassertStyle(String elementLocator, String styleText) Asserts that the effective style of the element identified by the given element locator matches the given style.protected voidassertText(String elementLocator, String text) Asserts that the text embedded by the given element contains the given text.protected voidassertTextPresent(String text) Asserts that the given text is present.protected voidassertTitle(String title) Asserts that the given title matches the page title.protected voidassertValue(String elementLocator, String valuePattern) Asserts that the value of the given element matches the given value.protected voidassertVisible(String elementLocator) Asserts that the given element is visible.protected voidassertXpathCount(String xpath, int count) Asserts that the number of elements locatable by the given XPath expression is equal to the given count.protected voidassertXpathCount(String xpath, String count) Asserts that the number of elements locatable by the given XPath expression is equal to the given count.protected HtmlPageChecks/toggles the given element.protected HtmlPagecheckAndWait(String elementLocator) Checks/toggles the given element and waits for some activity to complete.protected HtmlPageClicks the given element.protected HtmlPageclickAndWait(String elementLocator) Clicks the given element and waits for some activity to complete.protected voidclose()Closes the current window if it is a top-level window.protected HtmlPagecontextMenu(String elementLocator) Simulates a right-click on the given element.protected HtmlPagecontextMenuAt(String elementLocator, int coordX, int coordY) Simulates a right-click at the given coordinates (relative to the given element).protected HtmlPagecontextMenuAt(String elementLocator, String coordinates) Simulates a right-click at the given coordinates (relative to the given element).protected voidcreateCookie(String cookie) Creates a new cookie.protected voidcreateCookie(String cookie, String options) Creates a new cookie.protected voidRemoves all cookies visible to the current page.protected voiddeleteCookie(String name) Removes the cookie with the specified name.protected voiddeleteCookie(String name, String options) Removes the cookie with the specified name.protected HtmlPagedoubleClick(String elementLocator) Double-clicks the given element.protected HtmlPagedoubleClickAndWait(String elementLocator) Double-clicks the given element and waits for a page to be loaded.protected voidPrints the given message to the log.protected abstract HtmlPageExecutes the module steps.protected HtmlPagePresses the left mouse button on an element, but does not release the button yet.protected HtmlPagemouseDownAt(String elementLocator, int coordX, int coordY) Presses the left mouse button at the given coordinates (relative to the given element), but does not release the button yet.protected HtmlPagemouseDownAt(String elementLocator, String coordinates) Presses the left mouse button at the given coordinates (relative to the given element), but does not release the button yet.protected HtmlPageMoves the mouse to the given element.protected HtmlPagemouseMoveAt(String elementLocator, int coordX, int coordY) Moves the mouse to the given coordinates (relative to the given element).protected HtmlPagemouseMoveAt(String elementLocator, String coordinates) Moves the mouse to the given coordinates (relative to the given element).protected HtmlPageMoves the mouse out of the element's bounding box.protected HtmlPageHovers the mouse over an element.protected HtmlPageReleases the left mouse button on an element.protected HtmlPageReleases the left mouse button at the given coordinates (relative to the given element).protected HtmlPageReleases the left mouse button at the given coordinates (relative to the given element).protected HtmlPageOpens the given URL.protected HtmlPageOpens the given URL.protected HtmlPagepause(long waitingTime) Waits the given time.protected HtmlPageWaits the given time.protected HtmlPageremoveSelection(String select, String option) Removes the given option of the given select from the current selection.Runs the module.protected HtmlPageSelects the given option of the given select.protected HtmlPageselectAndWait(String select, String option) Selects the given option of the given select and waits for some activity to complete.protected HtmlPageselectFrame(String frameTarget) Selects the given frame.protected HtmlPageSelects the top-level window.protected HtmlPageselectWindow(String windowTarget) Selects the given window.protected voidsetTimeout(long timeout) Sets the timeout to the given value.protected voidsetTimeout(String timeout) Sets the timeout to the given value.protected voidStores the given text to the given variable.protected voidstoreAttribute(String attributeLocator, String variableName) Stores the value of the attribute identified by the given attribute locator to the given variableprotected voidstoreAttribute(String elementLocator, String attributeName, String variableName) Stores the value of the given element and attribute to the given variable.protected voidstoreElementCount(String elementLocator, String variableName) Stores that the number of elements found by using the given element locator to the given variable.protected voidStores the result of evaluating the given expression to the given variable.protected voidStores the text of the element identified by the given locator to the given variable.protected voidstoreTitle(String variableName) Stores the title of the currently active document to the given variable.protected voidstoreValue(String elementLocator, String variableName) Stores the value (in case of a<textarea>the contained text) of the element identified by the given locator to the given variable.protected voidstoreXpathCount(String xpath, String variableName) Stores the number of elements matching the given XPath expression to the given variable.protected HtmlPageSubmits the given form.protected HtmlPagesubmitAndWait(String form) Submits the given form and waits for some activity to complete.protected HtmlPageTypes the given text into the given input field.protected HtmlPagetypeAndWait(String elementLocator, String text) Types the given text into the given input field and waits for some activity to complete.protected HtmlPageUnchecks the given checkbox/radio button.protected HtmlPageuncheckAndWait(String elementLocator) Unchecks the given checkbox/radio button and waits for a page load.protected HtmlPagewaitForAttribute(String attributeLocator, String textPattern) Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.protected HtmlPagewaitForAttribute(String elementLocator, String attributeName, String textPattern) Waits until the value of the given element and attribute matches the given text pattern.protected HtmlPagewaitForChecked(String elementLocator) Waits until the given checkbox/radio button becomes checked.protected HtmlPagewaitForClass(String elementLocator, String clazzString) Waits until the given element has the given class(es).protected HtmlPagewaitForElementCount(String elementLocator, int count) Waits until the number of elements found by using the given element locator is equal to the given count.protected HtmlPagewaitForElementCount(String elementLocator, String count) Waits until the number of elements found by using the given element locator is equal to the given count.protected HtmlPagewaitForElementPresent(String elementLocator) Waits for the given element to appear.protected HtmlPagewaitForEval(String expression, String textPattern) Waits until the result of evaluating the given expression matches the given text pattern.protected HtmlPagewaitForNotAttribute(String attributeLocator, String textPattern) Waits until the value of the attribute identified by the given attribute locator does NOT match the given text pattern.protected HtmlPagewaitForNotAttribute(String elementLocator, String attributeName, String textPattern) Waits until the value of the given element and attribute does NOT match the given text pattern.protected HtmlPagewaitForNotChecked(String elementLocator) Waits until the given checkbox/radio button becomes unchecked.protected HtmlPagewaitForNotClass(String elementLocator, String clazzString) Waits until the given element doesn't have the given class(es).protected HtmlPagewaitForNotElementCount(String elementLocator, int count) Waits until the number of elements found by using the given element locator is unequal to the given count.protected HtmlPagewaitForNotElementCount(String elementLocator, String count) Waits until the number of elements found by using the given element locator is unequal to the given count.protected HtmlPagewaitForNotElementPresent(String elementLocator) Waits for the given element to disappear.protected HtmlPagewaitForNotEval(String expression, String textPattern) Waits until the result of evaluating the given expression does NOT match the given text pattern.protected HtmlPagewaitForNotSelectedId(String selectLocator, String idPattern) Waits until no ID of all selected options of the given select element matches the given pattern.protected HtmlPagewaitForNotSelectedIndex(String selectLocator, String indexPattern) Waits until the option of the given select element at the given index is not selected.protected HtmlPagewaitForNotSelectedLabel(String selectLocator, String labelPattern) Waits until no label of all selected options of the given select element matches the given pattern.protected HtmlPagewaitForNotSelectedValue(String selectLocator, String valuePattern) Waits until no value of all selected options of the given select element matches the given pattern.protected HtmlPagewaitForNotStyle(String elementLocator, String styleText) Waits until the effective style of the element identified by the given element locator does NOT match the given style.protected HtmlPagewaitForNotText(String elementLocator, String text) Waits for the given text embedded in the given element to disappear/change.protected HtmlPagewaitForNotTextPresent(String text) Waits for the given text to disappear/change.protected HtmlPagewaitForNotTitle(String title) Waits for the given page title change.protected voidwaitForNotValue(String elementLocator, String valuePattern) Waits for the given value in the given element to disappear/change.protected HtmlPagewaitForNotVisible(String elementLocator) Waits until the given element becomes invisible.protected HtmlPagewaitForNotXpathCount(String xpath, int count) Waits for the number of elements matching the given XPath expression change to a different value than the given one.protected HtmlPagewaitForNotXpathCount(String xpath, String count) Waits for the number of elements matching the given XPath expression change to a different value than the given one.protected HtmlPageWaits for the page to load.protected voidWaits for any pop-up window to be loaded completely.protected voidwaitForPopUp(String windowID) Waits for some pop-up window to be loaded completely.protected voidwaitForPopUp(String windowID, long maxWaitingTime) Waits at most the given time for some pop-up window to be loaded completely.protected voidwaitForPopUp(String windowID, String maxWaitingTime) Waits at most the given time for some pop-up window to be loaded completely.protected HtmlPagewaitForSelectedId(String selectLocator, String idPattern) Waits until the ID of at least one selected option of the given select element matches the given pattern.protected HtmlPagewaitForSelectedIndex(String selectLocator, String indexPattern) Waits until the option of the given select element at the given index is selected.protected HtmlPagewaitForSelectedLabel(String selectLocator, String labelPattern) Waits until the label of at least one selected option of the given select element matches the given pattern.protected HtmlPagewaitForSelectedValue(String selectLocator, String valuePattern) Waits until the value of at least one selected option of the given select element matches the given pattern.protected HtmlPagewaitForStyle(String elementLocator, String styleText) Waits until the effective style of the element identified by the given element locator matches the given style.protected HtmlPagewaitForText(String elementLocator, String text) Waits for the given text embedded in the given element.protected HtmlPagewaitForTextPresent(String text) Waits for the given text to appear.protected HtmlPagewaitForTitle(String title) Waits for the given page title.protected HtmlPagewaitForValue(String elementLocator, String valuePattern) Waits for the given value in the given element.protected HtmlPagewaitForVisible(String elementLocator) Waits until the given element becomes visible.protected HtmlPagewaitForXpathCount(String xpath, int count) Waits for the number of elements matching the given XPath expression is equal to the given count.protected HtmlPagewaitForXpathCount(String xpath, String count) Waits for the number of elements matching the given XPath expression is equal to the given count.Methods inherited from class com.xceptance.xlt.api.engine.scripting.AbstractHtmlUnitScriptModule
evaluatesToTrue, resolve, resolveKey
-
Constructor Details
-
AbstractHtmlUnitCommandsModule
public AbstractHtmlUnitCommandsModule()
-
-
Method Details
-
execute
Executes the module steps.- Parameters:
page- the HTML page to start at- Returns:
- the resulting HTML page
- Throws:
Exception
-
run
Runs the module.- Parameters:
page- the HTML page to start at- Returns:
- the resulting HTML page
- Throws:
Exception
-
addSelection
Adds the given option of the given select to the current selection.- Parameters:
select- the selectoption- the option to be added to current selection
-
assertAttribute
Asserts that the value of the attribute identified by the given attribute locator matches the given text pattern.- Parameters:
attributeLocator- the attribute locatortextPattern- the text pattern that the attribute value must match
-
assertAttribute
Asserts that the value of the attribute identified by the given element locator and attribute name matches the given text pattern.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributetextPattern- the text pattern that the attribute value must match
-
assertChecked
Asserts that the given checkbox/radio button is checked.- Parameters:
elementLocator- the checkbox/radio button element locator
-
assertClass
Asserts that the given element has the given class(es).- Parameters:
elementLocator- the element locatorclazzString- the class(es) string
-
assertElementCount
Asserts that the number of elements found by using the given element locator is equal to the given count.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
assertElementCount
Asserts that the number of elements found by using the given element locator is equal to the given count.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
assertElementPresent
Asserts that the given element is present.- Parameters:
elementLocator- locator identifying the element that should be present
-
assertEval
Asserts that evaluating the given expression matches the given text pattern.- Parameters:
expression- the expression to evaluatetextPattern- the text pattern that the evaluation result must match
-
assertLoadTime
protected void assertLoadTime(long loadTime) Asserts that the time needed to load a page does not exceed the given value.- Parameters:
loadTime- maximum load time in milliseconds
-
assertLoadTime
Asserts that the time needed to load a page does not exceed the given value.- Parameters:
loadTime- maximum load time in milliseconds
-
assertNotAttribute
Asserts that the value of the attribute identified by the given attribute locator does NOT match the given text pattern.- Parameters:
attributeLocator- the attribute locatortextPattern- the text pattern that the attribute value must NOT match
-
assertNotAttribute
Asserts that the value of the attribute identified by the given element locator and attribute name does NOT match the given text pattern.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributetextPattern- the text pattern that the attribute value must NOT match
-
assertNotChecked
Asserts that the given checkbox/radio button is unchecked.- Parameters:
elementLocator- the checkbox/radio button element locator
-
assertNotClass
Asserts that the given element doesn't have the given class(es).- Parameters:
elementLocator- the element locatorclazzString- the class(es) string
-
assertNotElementCount
Asserts that the number of elements found by using the given element locator is unequal to the given count.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
assertNotElementCount
Asserts that the number of elements found by using the given element locator is unequal to the given count.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
assertNotElementPresent
Asserts that the given element is not present.- Parameters:
elementLocator- locator identifying the element that should be NOT present
-
assertNotEval
Asserts that evaluating the given expression does NOT match the given text pattern.- Parameters:
expression- the expression to evaluatetextPattern- the text pattern that the evaluation result must NOT match
-
assertNotSelectedId
Asserts that no ID of all selected options of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatoridPattern- ID pattern that must not patch
-
assertNotSelectedIndex
Asserts that the option of the given select element at the given index is not selected.- Parameters:
selectLocator- the select element locatorindexPattern- the option index pattern
-
assertNotSelectedLabel
Asserts that no label of all selected options of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatorlabelPattern- the label pattern that must not match
-
assertNotSelectedValue
Asserts that no value of all selected options of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatorvaluePattern- the value pattern that must not match
-
assertNotStyle
Asserts that the effective style of the element identified by the given element locator does NOT match the given style.- Parameters:
elementLocator- the element locatorstyleText- the style that must NOT match (e.g.width: 10px; overflow: hidden;)
-
assertNotText
Asserts that the embedded text of the given element does not contain the given text.- Parameters:
elementLocator- locator identifying the elementtext- the text that should not be embedded in the given element
-
assertNotTextPresent
Asserts that the given text is not present on the page.- Parameters:
text- the text that should NOT be present
-
assertNotTitle
Asserts that the page title does not match the given title.- Parameters:
title- the title that should not match
-
assertNotValue
Asserts that the value of the given element doesn't match the given value. If the element is a <textarea> this method asserts that the containing text doesn't match the given value.- Parameters:
elementLocator- locator identifying the element whose value doesn't match the given valuevaluePattern- the value that doesn't match the given element's value
-
assertNotVisible
Asserts that the given element is invisible.- Parameters:
elementLocator- the element locator
-
assertNotXpathCount
Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.- Parameters:
xpath- the XPath expressioncount- the number of elements that should NOT be equal to the actual number of elements matching the given XPath expression
-
assertNotXpathCount
Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.- Parameters:
xpath- the XPath expressioncount- the number of elements that should NOT be equal to the actual number of elements matching the given XPath expression
-
assertPageSize
protected void assertPageSize(long pageSize) Asserts that the size of the actual page (including images etc.) does not exceed the given value.- Parameters:
pageSize- the number of bytes the page size must not exceed
-
assertPageSize
Asserts that the size of the actual page (including images etc.) does not exceed the given value.- Parameters:
pageSize- the number of bytes the page size must not exceed
-
assertSelectedId
Asserts that the ID of at least one selected option of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatoridPattern- ID pattern that must match
-
assertSelectedIndex
Asserts that the option of the given select element at the given index is selected.- Parameters:
selectLocator- the select element locatorindexPattern- the option index pattern
-
assertSelectedLabel
Asserts that the label of at least one selected option of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatorlabelPattern- the label pattern that must match
-
assertSelectedValue
Asserts that the value of at least one selected option of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatorvaluePattern- the value pattern that must match
-
assertStyle
Asserts that the effective style of the element identified by the given element locator matches the given style.- Parameters:
elementLocator- the element locatorstyleText- the style to match (e.g.width: 10px; overflow: hidden;)
-
assertText
Asserts that the text embedded by the given element contains the given text.- Parameters:
elementLocator- locator identifying the element whose text should contain the given texttext- the text that should be embedded in the given element
-
assertTextPresent
Asserts that the given text is present.- Parameters:
text- the text that should be present
-
assertTitle
Asserts that the given title matches the page title.- Parameters:
title- the title that should match the page title
-
assertValue
Asserts that the value of the given element matches the given value. If the element is a <textarea> this method asserts that the containing text matches the given value.- Parameters:
elementLocator- locator identifying the element whose value should match the given valuevaluePattern- the value that should match the given element's value
-
assertVisible
Asserts that the given element is visible.- Parameters:
elementLocator- the element locator
-
assertXpathCount
Asserts that the number of elements locatable by the given XPath expression is equal to the given count.- Parameters:
xpath- the XPath expressioncount- the number of elements that must match the given XPath expression
-
assertXpathCount
Asserts that the number of elements locatable by the given XPath expression is equal to the given count.- Parameters:
xpath- the XPath expressioncount- the number of elements that must match the given XPath expression
-
check
Checks/toggles the given element.- Parameters:
elementLocator- locator identifying the element to be checked/toggled- Throws:
IOException
-
checkAndWait
Checks/toggles the given element and waits for some activity to complete.- Parameters:
elementLocator- locator identifying the element to be checked/toggled- Throws:
IOException
-
click
Clicks the given element.- Parameters:
elementLocator- locator identifying the element to be clicked.- Throws:
IOException
-
clickAndWait
Clicks the given element and waits for some activity to complete.- Parameters:
elementLocator- locator identifying the element to be clicked- Throws:
IOException
-
close
protected void close()Closes the current window if it is a top-level window. -
contextMenu
Simulates a right-click on the given element.- Parameters:
elementLocator- locator identifying the element to fire events at
-
contextMenuAt
Simulates a right-click at the given coordinates (relative to the given element).- Parameters:
elementLocator- locator identifying the target elementcoordinates- the coordinates relative to the given element
-
contextMenuAt
Simulates a right-click at the given coordinates (relative to the given element).- Parameters:
elementLocator- locator identifying the target elementcoordX- the X coordinate relative to the given elementcoordY- the Y coordinate relative to the given element
-
createCookie
Creates a new cookie. The new cookie will be stored as session cookie for the current path and domain.- Parameters:
cookie- name value pair of the new cookie
-
createCookie
Creates a new cookie.- Parameters:
cookie- name value pair of the new cookieoptions- cookie creation options (path, max_age and domain)
-
deleteAllVisibleCookies
protected void deleteAllVisibleCookies()Removes all cookies visible to the current page. -
deleteCookie
Removes the cookie with the specified name.- Parameters:
name- the cookie's name
-
deleteCookie
Removes the cookie with the specified name.- Parameters:
name- the cookie's nameoptions- cookie removal options (path, domain and recurse)
-
doubleClick
Double-clicks the given element.- Parameters:
elementLocator- locator identifying the element to be double-clicked- Throws:
IOException
-
doubleClickAndWait
Double-clicks the given element and waits for a page to be loaded.- Parameters:
elementLocator- locator identifying the element to be double-clicked- Throws:
IOException
-
echo
Prints the given message to the log.- Parameters:
message- the message to print
-
mouseDown
Presses the left mouse button on an element, but does not release the button yet.- Parameters:
elementLocator- locator identifying the target element
-
mouseDownAt
Presses the left mouse button at the given coordinates (relative to the given element), but does not release the button yet.- Parameters:
elementLocator- locator identifying the target elementcoordinates- the coordinates relative to the given element
-
mouseDownAt
Presses the left mouse button at the given coordinates (relative to the given element), but does not release the button yet.- Parameters:
elementLocator- locator identifying the target elementcoordX- the X coordinate relative to the given elementcoordY- the Y coordinate relative to the given element
-
mouseMove
Moves the mouse to the given element.- Parameters:
elementLocator- locator identifying the target element
-
mouseMoveAt
Moves the mouse to the given coordinates (relative to the given element).- Parameters:
elementLocator- locator identifying the target elementcoordinates- the coordinates relative to the given element
-
mouseMoveAt
Moves the mouse to the given coordinates (relative to the given element).- Parameters:
elementLocator- locator identifying the target elementcoordX- the X coordinate relative to the given elementcoordY- the Y coordinate relative to the given element
-
mouseOut
Moves the mouse out of the element's bounding box.- Parameters:
elementLocator- locator identifying the target element
-
mouseOver
Hovers the mouse over an element.- Parameters:
elementLocator- locator identifying the target element
-
mouseUp
Releases the left mouse button on an element.- Parameters:
elementLocator- locator identifying the target element
-
mouseUpAt
Releases the left mouse button at the given coordinates (relative to the given element).- Parameters:
elementLocator- locator identifying the target elementcoordinates- the coordinates relative to the given element
-
mouseUpAt
Releases the left mouse button at the given coordinates (relative to the given element).- Parameters:
elementLocator- locator identifying the target elementcoordX- the X coordinate relative to the given elementcoordY- the Y coordinate relative to the given element
-
open
Opens the given URL.- Parameters:
urlToOpen- the URL to open- Returns:
- HTML page located at the given URL
- Throws:
Exception- thrown if access to the given URL has failed
-
open
Opens the given URL.- Parameters:
urlToOpen- the URL to open- Returns:
- HTML page located at the given URL
- Throws:
Exception- thrown if access to the given URL has failed
-
pause
Waits the given time.- Parameters:
waitingTime- the time in milliseconds to wait
-
pause
Waits the given time.- Parameters:
waitingTime- the time in milliseconds to wait
-
removeSelection
Removes the given option of the given select from the current selection.- Parameters:
select- the selectoption- the option to be removed from the current selection
-
select
Selects the given option of the given select.- Parameters:
select- the selectoption- the option to select
-
selectAndWait
Selects the given option of the given select and waits for some activity to complete.- Parameters:
select- the selectoption- the option to select
-
selectFrame
Selects the given frame.- Parameters:
frameTarget- the frame to be selected
-
selectWindow
Selects the top-level window. -
selectWindow
Selects the given window.- Parameters:
windowTarget- the window to be selected
-
setTimeout
protected void setTimeout(long timeout) Sets the timeout to the given value.- Parameters:
timeout- the new timeout in milliseconds
-
setTimeout
Sets the timeout to the given value.- Parameters:
timeout- the new timeout in milliseconds
-
store
Stores the given text to the given variable.- Parameters:
text- the text to storevariableName- the variable name
-
storeAttribute
Stores the value of the attribute identified by the given attribute locator to the given variable- Parameters:
attributeLocator- the attribute locatorvariableName- the variable name
-
storeAttribute
Stores the value of the given element and attribute to the given variable.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributevariableName- the variable name
-
storeElementCount
Stores that the number of elements found by using the given element locator to the given variable.- Parameters:
elementLocator- the element locatorvariableName- the variable name
-
storeEval
Stores the result of evaluating the given expression to the given variable.- Parameters:
expression- the expression to evaluatevariableName- the variable
-
storeText
Stores the text of the element identified by the given locator to the given variable.- Parameters:
elementLocator- the element locatorvariableName- the variable
-
storeTitle
Stores the title of the currently active document to the given variable.- Parameters:
variableName- the name of the variable
-
storeValue
Stores the value (in case of a<textarea>the contained text) of the element identified by the given locator to the given variable.- Parameters:
elementLocator- the element locatorvariableName- the variable
-
storeXpathCount
Stores the number of elements matching the given XPath expression to the given variable.- Parameters:
xpath- the XPath expressionvariableName- the variable
-
submit
Submits the given form.- Parameters:
form- the form to submit- Throws:
Exception
-
submitAndWait
Submits the given form and waits for some activity to complete.- Parameters:
form- the form to submit
-
type
Types the given text into the given input field.- Parameters:
elementLocator- locator identifying the input fieldtext- the text to be typed- Throws:
IOException
-
typeAndWait
Types the given text into the given input field and waits for some activity to complete.- Parameters:
elementLocator- locator identifying the input fieldtext- the text to be typed
-
uncheck
Unchecks the given checkbox/radio button.- Parameters:
elementLocator- locator identifying the checkbox/radio button- Throws:
IOException
-
uncheckAndWait
Unchecks the given checkbox/radio button and waits for a page load.- Parameters:
elementLocator- locator identifying the checkbox/radio button- Throws:
IOException
-
waitForAttribute
Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.- Parameters:
attributeLocator- the attribute locatortextPattern- the text pattern
-
waitForAttribute
protected HtmlPage waitForAttribute(String elementLocator, String attributeName, String textPattern) Waits until the value of the given element and attribute matches the given text pattern.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributetextPattern- the text pattern
-
waitForChecked
Waits until the given checkbox/radio button becomes checked.- Parameters:
elementLocator- the checkbox/radio button element locator
-
waitForClass
Waits until the given element has the given class(es).- Parameters:
elementLocator- the element locatorclazzString- the class(es) string
-
waitForElementCount
Waits until the number of elements found by using the given element locator is equal to the given count.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
waitForElementCount
Waits until the number of elements found by using the given element locator is equal to the given count.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
waitForElementPresent
Waits for the given element to appear.- Parameters:
elementLocator- locator identifying the element to wait for
-
waitForEval
Waits until the result of evaluating the given expression matches the given text pattern.- Parameters:
expression- the expression to evaluatetextPattern- textPattern the text pattern the evaluation result must match
-
waitForNotAttribute
Waits until the value of the attribute identified by the given attribute locator does NOT match the given text pattern.- Parameters:
attributeLocator- the attribute locatortextPattern- the text pattern that must NOT match
-
waitForNotAttribute
protected HtmlPage waitForNotAttribute(String elementLocator, String attributeName, String textPattern) Waits until the value of the given element and attribute does NOT match the given text pattern.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributetextPattern- the text pattern
-
waitForNotChecked
Waits until the given checkbox/radio button becomes unchecked.- Parameters:
elementLocator- the checkbox/radio button element locator
-
waitForNotClass
Waits until the given element doesn't have the given class(es).- Parameters:
elementLocator- the element locatorclazzString- the class(es) string
-
waitForNotElementCount
Waits until the number of elements found by using the given element locator is unequal to the given count.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
waitForNotElementCount
Waits until the number of elements found by using the given element locator is unequal to the given count.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
waitForNotElementPresent
Waits for the given element to disappear.- Parameters:
elementLocator- locator identifying the element to disappear
-
waitForNotEval
Waits until the result of evaluating the given expression does NOT match the given text pattern.- Parameters:
expression- the expression to evaluatetextPattern- the text pattern that the evaluation result must NOT match
-
waitForNotSelectedId
Waits until no ID of all selected options of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatoridPattern- the ID pattern that must not match
-
waitForNotSelectedIndex
Waits until the option of the given select element at the given index is not selected.- Parameters:
selectLocator- the select element locatorindexPattern- the option index pattern
-
waitForNotSelectedLabel
Waits until no label of all selected options of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatorlabelPattern- the label pattern
-
waitForNotSelectedValue
Waits until no value of all selected options of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatorvaluePattern- the value pattern
-
waitForNotStyle
Waits until the effective style of the element identified by the given element locator does NOT match the given style.- Parameters:
elementLocator- the element locatorstyleText- the style that must NOT match (e.g.width: 10px; overflow: hidden;)
-
waitForNotText
Waits for the given text embedded in the given element to disappear/change.- Parameters:
elementLocator- locator identifying the element whose embedded text should changetext- the text that should change/disappear
-
waitForNotTextPresent
Waits for the given text to disappear/change.- Parameters:
text- the text that should disappear/change
-
waitForNotTitle
Waits for the given page title change.- Parameters:
title- the page title that should change
-
waitForNotValue
Waits for the given value in the given element to disappear/change.- Parameters:
elementLocator- locator identifying the element whose value should changevaluePattern- the value that should change/disappear
-
waitForNotVisible
Waits until the given element becomes invisible.- Parameters:
elementLocator- the element locator
-
waitForNotXpathCount
Waits for the number of elements matching the given XPath expression change to a different value than the given one.- Parameters:
xpath- the XPath expressioncount- the number of elements currently matching the given XPath expression
-
waitForNotXpathCount
Waits for the number of elements matching the given XPath expression change to a different value than the given one.- Parameters:
xpath- the XPath expressioncount- the number of elements currently matching the given XPath expression
-
waitForPageToLoad
Waits for the page to load. -
waitForPopUp
protected void waitForPopUp()Waits for any pop-up window to be loaded completely. -
waitForPopUp
Waits for some pop-up window to be loaded completely.- Parameters:
windowID- the ID of the window to wait for
-
waitForPopUp
Waits at most the given time for some pop-up window to be loaded completely.- Parameters:
windowID- the ID of the window to wait formaxWaitingTime- the maximum waiting time
-
waitForPopUp
Waits at most the given time for some pop-up window to be loaded completely.- Parameters:
windowID- the ID of the window to wait formaxWaitingTime- the maximum waiting time
-
waitForSelectedId
Waits until the ID of at least one selected option of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatoridPattern- the ID pattern
-
waitForSelectedIndex
Waits until the option of the given select element at the given index is selected.- Parameters:
selectLocator- the select element locatorindexPattern- the option index pattern
-
waitForSelectedLabel
Waits until the label of at least one selected option of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatorlabelPattern- the label pattern
-
waitForSelectedValue
Waits until the value of at least one selected option of the given select element matches the given pattern.- Parameters:
selectLocator- the select element locatorvaluePattern- the value pattern
-
waitForStyle
Waits until the effective style of the element identified by the given element locator matches the given style.- Parameters:
elementLocator- the element locatorstyleText- the style that must match (e.g.width: 10px; overflow: hidden;)
-
waitForText
Waits for the given text embedded in the given element.- Parameters:
elementLocator- locator identifying the element whose text should contain the given texttext- the text to wait for
-
waitForTextPresent
Waits for the given text to appear.- Parameters:
text- the text to wait for
-
waitForTitle
Waits for the given page title.- Parameters:
title- the page title to wait for
-
waitForValue
Waits for the given value in the given element.- Parameters:
elementLocator- locator identifying the element whose value should match the given valuevaluePattern- the value to wait for
-
waitForVisible
Waits until the given element becomes visible.- Parameters:
elementLocator- the element locator
-
waitForXpathCount
Waits for the number of elements matching the given XPath expression is equal to the given count.- Parameters:
xpath- the XPath expressioncount- the number of elements to wait for
-
waitForXpathCount
Waits for the number of elements matching the given XPath expression is equal to the given count.- Parameters:
xpath- the XPath expressioncount- the number of elements to wait for
-