Class AbstractWebDriverScriptTestCase
- java.lang.Object
-
- com.xceptance.xlt.api.tests.AbstractTestCase
-
- com.xceptance.xlt.api.tests.AbstractWebDriverTestCase
-
- com.xceptance.xlt.api.engine.scripting.AbstractWebDriverScriptTestCase
-
- All Implemented Interfaces:
ScriptCommands
public abstract class AbstractWebDriverScriptTestCase extends AbstractWebDriverTestCase implements ScriptCommands
Base class of all exported script test cases that rely on theWebDriver
API.
-
-
Constructor Summary
Constructors Constructor Description AbstractWebDriverScriptTestCase()
Creates a new test case instance and initializes it with a defaultWebDriver
instance and an empty base URL.AbstractWebDriverScriptTestCase(java.lang.String baseUrl)
Creates a new test case instance and initializes it with a defaultWebDriver
instance and the given base URL.AbstractWebDriverScriptTestCase(WebDriver driver)
Creates a new test case instance and initializes it with the givenWebDriver
instance and an empty base URL.AbstractWebDriverScriptTestCase(WebDriver driver, java.lang.String baseUrl)
Creates a new test case instance and initializes it with the givenWebDriver
instance and the given base URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
__cleanUpAbstractWebDriverScriptTestCase()
Performs additional cleanup tasks for WebDriver-based exported script test cases.void
__setUpAbstractWebDriverScriptTestCase()
Performs additional setup tasks for WebDriver-based exported script test cases.void
addSelection(java.lang.String select, java.lang.String option)
Adds the given option of the given select to the current selection.void
assertAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Asserts that the value of the attribute identified by the given attribute locator matches the given text pattern.void
assertAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)
Asserts that the value of the attribute identified by the given element locator and attribute name matches the given text pattern.void
assertChecked(java.lang.String elementLocator)
Asserts that the given checkbox/radio button is checked.void
assertClass(java.lang.String elementLocator, java.lang.String clazzString)
Asserts that the given element has the given class(es).void
assertElementCount(java.lang.String elementLocator, int count)
Asserts that the number of elements found by using the given element locator is equal to the given count.void
assertElementCount(java.lang.String elementLocator, java.lang.String count)
Asserts that the number of elements found by using the given element locator is equal to the given count.void
assertElementPresent(java.lang.String elementLocator)
Asserts that the given element is present.void
assertEval(java.lang.String expression, java.lang.String textPattern)
Asserts that evaluating the given expression matches the given text pattern.void
assertLoadTime(long loadTime)
Asserts that the time needed to load a page does not exceed the given value.void
assertLoadTime(java.lang.String loadTime)
Asserts that the time needed to load a page does not exceed the given value.void
assertNotAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Asserts that the value of the attribute identified by the given attribute locator does NOT match the given text pattern.void
assertNotAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.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.void
assertNotChecked(java.lang.String elementLocator)
Asserts that the given checkbox/radio button is unchecked.void
assertNotClass(java.lang.String elementLocator, java.lang.String clazzString)
Asserts that the given element doesn't have the given class(es).void
assertNotElementCount(java.lang.String elementLocator, int count)
Asserts that the number of elements found by using the given element locator is unequal to the given count.void
assertNotElementCount(java.lang.String elementLocator, java.lang.String count)
Asserts that the number of elements found by using the given element locator is unequal to the given count.void
assertNotElementPresent(java.lang.String elementLocator)
Asserts that the given element is not present.void
assertNotEval(java.lang.String expression, java.lang.String textPattern)
Asserts that evaluating the given expression does NOT match the given text pattern.void
assertNotSelectedId(java.lang.String selectLocator, java.lang.String idPattern)
Asserts that no ID of all selected options of the given select element matches the given pattern.void
assertNotSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)
Asserts that the option of the given select element at the given index is not selected.void
assertNotSelectedLabel(java.lang.String selectLocator, java.lang.String labelPattern)
Asserts that no label of all selected options of the given select element matches the given pattern.void
assertNotSelectedValue(java.lang.String selectLocator, java.lang.String valuePattern)
Asserts that no value of all selected options of the given select element matches the given pattern.void
assertNotStyle(java.lang.String elementLocator, java.lang.String styleText)
Asserts that the effective style of the element identified by the given element locator does NOT match the given style.void
assertNotText(java.lang.String elementLocator, java.lang.String text)
Asserts that the embedded text of the given element does not contain the given text.void
assertNotTextPresent(java.lang.String text)
Asserts that the given text is not present on the page.void
assertNotTitle(java.lang.String title)
Asserts that the page title does not match the given title.void
assertNotValue(java.lang.String elementLocator, java.lang.String value)
Asserts that the value of the given element doesn't match the given value.void
assertNotVisible(java.lang.String elementLocator)
Asserts that the given element is invisible.void
assertNotXpathCount(java.lang.String xpath, int count)
Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.void
assertNotXpathCount(java.lang.String xpath, java.lang.String count)
Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.void
assertPageSize(long pageSize)
Asserts that the size of the actual page (including images etc.) does not exceed the given value.void
assertPageSize(java.lang.String pageSize)
Asserts that the size of the actual page (including images etc.) does not exceed the given value.void
assertSelectedId(java.lang.String selectLocator, java.lang.String idPattern)
Asserts that the ID of at least one selected option of the given select element matches the given pattern.void
assertSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)
Asserts that the option of the given select element at the given index is selected.void
assertSelectedLabel(java.lang.String selectLocator, java.lang.String labelPattern)
Asserts that the label of at least one selected option of the given select element matches the given pattern.void
assertSelectedValue(java.lang.String selectLocator, java.lang.String valuePattern)
Asserts that the value of at least one selected option of the given select element matches the given pattern.void
assertStyle(java.lang.String elementLocator, java.lang.String styleText)
Asserts that the effective style of the element identified by the given element locator matches the given style.void
assertText(java.lang.String elementLocator, java.lang.String text)
Asserts that the text embedded by the given element contains the given text.void
assertTextPresent(java.lang.String text)
Asserts that the given text is present.void
assertTitle(java.lang.String title)
Asserts that the given title matches the page title.void
assertValue(java.lang.String elementLocator, java.lang.String value)
Asserts that the value of the given element matches the given value.void
assertVisible(java.lang.String elementLocator)
Asserts that the given element is visible.void
assertXpathCount(java.lang.String xpath, int count)
Asserts that the number of elements locatable by the given XPath expression is equal to the given count.void
assertXpathCount(java.lang.String xpath, java.lang.String count)
Asserts that the number of elements locatable by the given XPath expression is equal to the given count.void
check(java.lang.String elementLocator)
Checks/toggles the given element.void
checkAndWait(java.lang.String elementLocator)
Checks/toggles the given element and waits for some activity to complete.void
click(java.lang.String elementLocator)
Clicks the given element.void
clickAndWait(java.lang.String elementLocator)
Clicks the given element and waits for some activity to complete.void
close()
Closes the browser.void
contextMenu(java.lang.String elementLocator)
Simulates a right-click on the given element.void
contextMenuAt(java.lang.String elementLocator, int coordX, int coordY)
Simulates a right-click at the given coordinates (relative to the given element).void
contextMenuAt(java.lang.String elementLocator, java.lang.String coordinates)
Simulates a right-click at the given coordinates (relative to the given element).void
createCookie(java.lang.String cookie)
Creates a new cookie.void
createCookie(java.lang.String cookie, java.lang.String options)
Creates a new cookie.void
deleteAllVisibleCookies()
Removes all cookies visible to the current page.void
deleteCookie(java.lang.String name)
Removes the cookie with the specified name.void
deleteCookie(java.lang.String name, java.lang.String options)
Removes the cookie with the specified name.void
doubleClick(java.lang.String elementLocator)
Double-clicks the given element.void
doubleClickAndWait(java.lang.String elementLocator)
Double-clicks the given element and waits for some activity to complete.void
echo(java.lang.String message)
Prints the given message to the log.java.lang.String
evaluate(java.lang.String jsExpression)
Returns the result of evaluating the given JavaScript expression.boolean
evaluatesToTrue(java.lang.String jsExpression)
Returns whether or not the given expression evaluates totrue
.WebElement
findElement(java.lang.String elementLocator)
Returns the first element matching the given locator.java.util.List<WebElement>
findElements(java.lang.String elementLocator)
Returns all elements that match the given locator.java.lang.String
getAttribute(java.lang.String attributeLocator)
Returns the value of the given element attribute locator.java.lang.String
getAttribute(java.lang.String elementLocator, java.lang.String attributeName)
Returns the value of the given element and attribute.int
getElementCount(java.lang.String elementLocator)
Returns the number of matching elements.java.lang.String
getPageText()
Returns the (visible) text of the current page.java.lang.String
getText(java.lang.String elementLocator)
Returns the (visible) text of the given element.java.lang.String
getTitle()
Returns the title of the current page.java.lang.String
getValue(java.lang.String elementLocator)
Returns the value of the given element.int
getXpathCount(java.lang.String xpath)
Returns the number of elements matching the given XPath expression.boolean
hasAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Returns whether or not the value of the attribute identified by the given attribute locator matches the given text pattern.boolean
hasAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)
Returns whether or not the value of the given element and attribute matches the given text pattern.boolean
hasClass(java.lang.String elementLocator, java.lang.String clazz)
Returns whether or not the given element has the given class(es).boolean
hasNotClass(java.lang.String elementLocator, java.lang.String clazz)
Returns whether or not the given element doesn't have the given class(es); that is, its class attribute doesn't contain any of the given class(es).boolean
hasNotStyle(java.lang.String elementLocator, java.lang.String style)
Returns whether or not the given element doesn't have the given style; that is, none of the given CSS properties must match the element's actual style.boolean
hasStyle(java.lang.String elementLocator, java.lang.String style)
Returns whether or not the given element has the given style; that is, all of the given CSS properties must match the element's actual style.boolean
hasText(java.lang.String elementLocator, java.lang.String textPattern)
Checks that the text embedded by the given element contains the given text.boolean
hasTitle(java.lang.String title)
Checks that the given title matches the page title.boolean
hasValue(java.lang.String elementLocator, java.lang.String valuePattern)
Checks that the value of the given element matches the given value.boolean
isChecked(java.lang.String elementLocator)
Returns whether or not the element identified by the given element locator is checked.boolean
isElementPresent(java.lang.String elementLocator)
Returns whether or not there is an element for the given locator.boolean
isEnabled(java.lang.String elementLocator)
Returns whether or not the given element is enabled.boolean
isEvalMatching(java.lang.String expression, java.lang.String textPattern)
Returns whether or not the result of evaluating the given expression matches the given text pattern.boolean
isTextPresent(java.lang.String textPattern)
Checks that the given text is present.boolean
isVisible(java.lang.String elementLocator)
Returns whether or not the given element is visible.void
mouseDown(java.lang.String elementLocator)
Presses the left mouse button on an element, but does not release the button yet.void
mouseDownAt(java.lang.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.void
mouseDownAt(java.lang.String elementLocator, java.lang.String coordinates)
Presses the left mouse button at the given coordinates (relative to the given element), but does not release the button yet.void
mouseMove(java.lang.String elementLocator)
Moves the mouse to the given element.void
mouseMoveAt(java.lang.String elementLocator, int coordX, int coordY)
Moves the mouse to the given coordinates (relative to the given element).void
mouseMoveAt(java.lang.String elementLocator, java.lang.String coordinates)
Moves the mouse to the given coordinates (relative to the given element).void
mouseOut(java.lang.String elementLocator)
Moves the mouse out of the element's bounding box.void
mouseOver(java.lang.String elementLocator)
Hovers the mouse over an element.void
mouseUp(java.lang.String elementLocator)
Releases the left mouse button on an element.void
mouseUpAt(java.lang.String elementLocator, int coordX, int coordY)
Releases the left mouse button at the given coordinates (relative to the given element).void
mouseUpAt(java.lang.String elementLocator, java.lang.String coordinates)
Releases the left mouse button at the given coordinates (relative to the given element).void
open(java.lang.String pageUrlString)
Opens the given URL.void
open(java.net.URL url)
Opens the given URL.void
pause(long waitingTime)
Waits the given time.void
pause(java.lang.String waitingTime)
Waits the given time.void
removeSelection(java.lang.String select, java.lang.String option)
Removes the given option of the given select from the current selection.java.lang.String
resolve(java.lang.String resolvable)
Resolves the given string.java.lang.String
resolveKey(java.lang.String key)
Resolves the given test data keyvoid
select(java.lang.String select, java.lang.String option)
Selects the given option of the given select.void
selectAndWait(java.lang.String select, java.lang.String option)
Selects the given option of the given select and waits for some activity to complete.void
selectFrame(java.lang.String frameTarget)
Selects the given frame.void
selectWindow()
Selects the top-level window.void
selectWindow(java.lang.String windowTarget)
Selects the given window.void
setTimeout(long timeout)
Sets the timeout to the given value.void
setTimeout(java.lang.String timeout)
Sets the timeout to the given value.void
startAction(java.lang.String actionName)
Starts a new action using the given name.void
stopAction()
Stops the current action.void
store(java.lang.String text, java.lang.String variableName)
Stores the given text to the given variable.void
storeAttribute(java.lang.String attributeLocator, java.lang.String variableName)
Stores the value of the attribute identified by the given attribute locator to the given variablevoid
storeAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String variableName)
Stores the value of the given element and attribute to the given variable.void
storeElementCount(java.lang.String elementLocator, java.lang.String variableName)
Stores that the number of elements found by using the given element locator to the given variable.void
storeEval(java.lang.String expression, java.lang.String variableName)
Stores the result of evaluating the given expression to the given variable.void
storeText(java.lang.String elementLocator, java.lang.String variableName)
Stores the text of the element identified by the given locator to the given variable.void
storeTitle(java.lang.String variableName)
Stores the title of the currently active document to the given variable.void
storeValue(java.lang.String elementLocator, java.lang.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.void
storeXpathCount(java.lang.String xpath, java.lang.String variableName)
Stores the number of elements matching the given XPath expression to the given variable.void
submit(java.lang.String form)
Submits the given form.void
submitAndWait(java.lang.String form)
Submits the given form and waits for some activity to complete.void
type(java.lang.String elementLocator, java.lang.String text)
Types the given text into the given input field.void
typeAndWait(java.lang.String elementLocator, java.lang.String text)
Types the given text into the given input field and waits for some activity to complete.void
uncheck(java.lang.String elementLocator)
Unchecks the given checkbox/radio button.void
uncheckAndWait(java.lang.String elementLocator)
Unchecks the given checkbox/radio button and waits for a page load.void
waitForAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.void
waitForAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)
Waits until the value of the given element and attribute matches the given text pattern.void
waitForChecked(java.lang.String elementLocator)
Waits until the given checkbox/radio button becomes checked.void
waitForClass(java.lang.String elementLocator, java.lang.String clazzString)
Waits until the given element has the given class(es).void
waitForElementCount(java.lang.String elementLocator, int count)
Waits until the number of elements found by using the given element locator is equal to the given count.void
waitForElementCount(java.lang.String elementLocator, java.lang.String count)
Waits until the number of elements found by using the given element locator is equal to the given count.void
waitForElementPresent(java.lang.String elementLocator)
Waits for the given element to appear.void
waitForEval(java.lang.String expression, java.lang.String textPattern)
Waits until the result of evaluating the given expression matches the given text pattern.void
waitForNotAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Waits until the value of the attribute identified by the given attribute locator does NOT match the given text pattern.void
waitForNotAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)
Waits until the value of the given element and attribute does NOT match the given text pattern.void
waitForNotChecked(java.lang.String elementLocator)
Waits until the given checkbox/radio button becomes unchecked.void
waitForNotClass(java.lang.String elementLocator, java.lang.String clazzString)
Waits until the given element doesn't have the given class(es).void
waitForNotElementCount(java.lang.String elementLocator, int count)
Waits until the number of elements found by using the given element locator is unequal to the given count.void
waitForNotElementCount(java.lang.String elementLocator, java.lang.String count)
Waits until the number of elements found by using the given element locator is unequal to the given count.void
waitForNotElementPresent(java.lang.String elementLocator)
Waits for the given element to disappear.void
waitForNotEval(java.lang.String expression, java.lang.String textPattern)
Waits until the result of evaluating the given expression does NOT match the given text pattern.void
waitForNotSelectedId(java.lang.String selectLocator, java.lang.String idPattern)
Waits until no ID of all selected options of the given select matches the given pattern.void
waitForNotSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)
Waits until the option of the given select element at the given index is not selected.void
waitForNotSelectedLabel(java.lang.String selectLocator, java.lang.String labelPattern)
Waits until no label of all selected options of the given select matches the given pattern.void
waitForNotSelectedValue(java.lang.String selectLocator, java.lang.String valuePattern)
Waits until no value of all selected options of the given select matches the given pattern.void
waitForNotStyle(java.lang.String elementLocator, java.lang.String styleText)
Waits until the effective style of the element identified by the given element locator does NOT match the given style.void
waitForNotText(java.lang.String elementLocator, java.lang.String text)
Waits for the given text embedded in the given element to disappear/change.void
waitForNotTextPresent(java.lang.String text)
Waits for the given text to disappear/change.void
waitForNotTitle(java.lang.String title)
Waits for the given page title change.void
waitForNotValue(java.lang.String elementLocator, java.lang.String value)
Waits for the given value in the given element to disappear/change.void
waitForNotVisible(java.lang.String elementLocator)
Waits until the given element becomes invisible.void
waitForNotXpathCount(java.lang.String xpath, int count)
Waits for the number of elements matching the given XPath expression change to a different value than the given one.void
waitForNotXpathCount(java.lang.String xpath, java.lang.String count)
Waits for the number of elements matching the given XPath expression change to a different value than the given one.void
waitForPageToLoad()
Waits for the page to be loaded completely.void
waitForPopUp()
Waits for any pop-up window to be loaded completely.void
waitForPopUp(java.lang.String windowID)
Waits for some pop-up window to be loaded completely.void
waitForPopUp(java.lang.String windowID, long maxWaitingTime)
Waits at most the given time for some pop-up window to be loaded completely.void
waitForPopUp(java.lang.String windowID, java.lang.String maxWaitingTime)
Waits at most the given time for some pop-up window to be loaded completely.void
waitForSelectedId(java.lang.String selectLocator, java.lang.String idPattern)
Waits until the ID of at least one selected option of the given select matches the given pattern.void
waitForSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)
Waits until the option of the given select at the given index is selected.void
waitForSelectedLabel(java.lang.String selectLocator, java.lang.String labelPattern)
Waits until the label of at least one selected option of the given select matches the given pattern.void
waitForSelectedValue(java.lang.String selectLocator, java.lang.String valuePattern)
Waits until the value of at least one selected option of the given select matches the given pattern.void
waitForStyle(java.lang.String elementLocator, java.lang.String styleText)
Waits until the effective style of the element identified by the given element locator matches the given style.void
waitForText(java.lang.String elementLocator, java.lang.String text)
Waits for the given text embedded in the given element.void
waitForTextPresent(java.lang.String text)
Waits for the given text to appear.void
waitForTitle(java.lang.String title)
Waits for the given page title.void
waitForValue(java.lang.String elementLocator, java.lang.String value)
Waits for the given value in the given element.void
waitForVisible(java.lang.String elementLocator)
Waits until the given element becomes visible.void
waitForXpathCount(java.lang.String xpath, int count)
Waits for the number of elements matching the given XPath expression is equal to the given count.void
waitForXpathCount(java.lang.String xpath, java.lang.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.tests.AbstractWebDriverTestCase
__quitWebDriver, getWebDriver, setWebDriver
-
Methods inherited from class com.xceptance.xlt.api.tests.AbstractTestCase
__setup, __tearDown, getEffectiveKey, getProperty, getProperty, getProperty, getProperty, getSimpleName, getTestDataSet, getTestName, reconfigureStartUrl, setTestDataSet, setTestName, setTestName, setUp, tearDown
-
-
-
-
Constructor Detail
-
AbstractWebDriverScriptTestCase
public AbstractWebDriverScriptTestCase()
Creates a new test case instance and initializes it with a defaultWebDriver
instance and an empty base URL. What the default driver will be can be configured in the settings of your test suite.Note: Since the driver will be created implicitly, it will also be quit implicitly.
-
AbstractWebDriverScriptTestCase
public AbstractWebDriverScriptTestCase(java.lang.String baseUrl)
Creates a new test case instance and initializes it with a defaultWebDriver
instance and the given base URL. What the default driver will be can be configured in the settings of your test suite.Note: Since the driver will be created implicitly, it will also be quit implicitly.
- Parameters:
baseUrl
- the base URL against which relative URLs will be resolved
-
AbstractWebDriverScriptTestCase
public AbstractWebDriverScriptTestCase(WebDriver driver)
Creates a new test case instance and initializes it with the givenWebDriver
instance and an empty base URL.Note: If the passed driver is non-null, that is the driver was created by you, you are also responsible to quit the driver after the test. However, if the passed driver is null, a default driver will be created and managed internally.
- Parameters:
driver
- theWebDriver
instance to use
-
AbstractWebDriverScriptTestCase
public AbstractWebDriverScriptTestCase(WebDriver driver, java.lang.String baseUrl)
Creates a new test case instance and initializes it with the givenWebDriver
instance and the given base URL.Note: If the passed driver is non-null, that is the driver was created by you, you are also responsible to quit the driver after the test. However, if the passed driver is null, a default driver will be created and managed internally.
- Parameters:
driver
- theWebDriver
instance to usebaseUrl
- the base URL against which relative URLs will be resolved
-
-
Method Detail
-
addSelection
public void addSelection(java.lang.String select, java.lang.String option)
Adds the given option of the given select to the current selection.- Specified by:
addSelection
in interfaceScriptCommands
- Parameters:
select
- the selectoption
- the option to be added to current selection
-
assertAttribute
public void assertAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Asserts that the value of the attribute identified by the given attribute locator matches the given text pattern.- Specified by:
assertAttribute
in interfaceScriptCommands
- Parameters:
attributeLocator
- the attribute locatortextPattern
- the text pattern that the attribute value must match
-
assertAttribute
public void assertAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)
Asserts that the value of the attribute identified by the given element locator and attribute name matches the given text pattern.- Specified by:
assertAttribute
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorattributeName
- the name of the attributetextPattern
- the text pattern that the attribute value must match
-
assertChecked
public void assertChecked(java.lang.String elementLocator)
Asserts that the given checkbox/radio button is checked.- Specified by:
assertChecked
in interfaceScriptCommands
- Parameters:
elementLocator
- the checkbox/radio button element locator
-
assertClass
public void assertClass(java.lang.String elementLocator, java.lang.String clazzString)
Asserts that the given element has the given class(es).- Specified by:
assertClass
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorclazzString
- the class(es) string
-
assertElementCount
public void assertElementCount(java.lang.String elementLocator, int count)
Asserts that the number of elements found by using the given element locator is equal to the given count.- Specified by:
assertElementCount
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorcount
- the number of elements
-
assertElementCount
public void assertElementCount(java.lang.String elementLocator, java.lang.String count)
Asserts that the number of elements found by using the given element locator is equal to the given count.- Specified by:
assertElementCount
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorcount
- the number of elements
-
assertElementPresent
public void assertElementPresent(java.lang.String elementLocator)
Asserts that the given element is present.- Specified by:
assertElementPresent
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element that should be present
-
assertEval
public void assertEval(java.lang.String expression, java.lang.String textPattern)
Asserts that evaluating the given expression matches the given text pattern.- Specified by:
assertEval
in interfaceScriptCommands
- Parameters:
expression
- the expression to evaluatetextPattern
- the text pattern that the evaluation result must match
-
assertLoadTime
public void assertLoadTime(long loadTime)
Asserts that the time needed to load a page does not exceed the given value.- Specified by:
assertLoadTime
in interfaceScriptCommands
- Parameters:
loadTime
- maximum load time in milliseconds
-
assertLoadTime
public void assertLoadTime(java.lang.String loadTime)
Asserts that the time needed to load a page does not exceed the given value.- Specified by:
assertLoadTime
in interfaceScriptCommands
- Parameters:
loadTime
- maximum load time in milliseconds
-
assertNotAttribute
public void assertNotAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Asserts that the value of the attribute identified by the given attribute locator does NOT match the given text pattern.- Specified by:
assertNotAttribute
in interfaceScriptCommands
- Parameters:
attributeLocator
- the attribute locatortextPattern
- the text pattern that the attribute value must NOT match
-
assertNotAttribute
public void assertNotAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.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.- Specified by:
assertNotAttribute
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorattributeName
- the name of the attributetextPattern
- the text pattern that the attribute value must NOT match
-
assertNotChecked
public void assertNotChecked(java.lang.String elementLocator)
Asserts that the given checkbox/radio button is unchecked.- Specified by:
assertNotChecked
in interfaceScriptCommands
- Parameters:
elementLocator
- the checkbox/radio button element locator
-
assertNotClass
public void assertNotClass(java.lang.String elementLocator, java.lang.String clazzString)
Asserts that the given element doesn't have the given class(es).- Specified by:
assertNotClass
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorclazzString
- the class(es) string
-
assertNotElementCount
public void assertNotElementCount(java.lang.String elementLocator, int count)
Asserts that the number of elements found by using the given element locator is unequal to the given count.- Specified by:
assertNotElementCount
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorcount
- the number of elements
-
assertNotElementCount
public void assertNotElementCount(java.lang.String elementLocator, java.lang.String count)
Asserts that the number of elements found by using the given element locator is unequal to the given count.- Specified by:
assertNotElementCount
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorcount
- the number of elements
-
assertNotElementPresent
public void assertNotElementPresent(java.lang.String elementLocator)
Asserts that the given element is not present.- Specified by:
assertNotElementPresent
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element that should be NOT present
-
assertNotEval
public void assertNotEval(java.lang.String expression, java.lang.String textPattern)
Asserts that evaluating the given expression does NOT match the given text pattern.- Specified by:
assertNotEval
in interfaceScriptCommands
- Parameters:
expression
- the expression to evaluatetextPattern
- the text pattern that the evaluation result must NOT match
-
assertNotSelectedId
public void assertNotSelectedId(java.lang.String selectLocator, java.lang.String idPattern)
Asserts that no ID of all selected options of the given select element matches the given pattern.- Specified by:
assertNotSelectedId
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatoridPattern
- the ID pattern
-
assertNotSelectedIndex
public void assertNotSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)
Asserts that the option of the given select element at the given index is not selected.- Specified by:
assertNotSelectedIndex
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorindexPattern
- the option index pattern
-
assertNotSelectedLabel
public void assertNotSelectedLabel(java.lang.String selectLocator, java.lang.String labelPattern)
Asserts that no label of all selected options of the given select element matches the given pattern.- Specified by:
assertNotSelectedLabel
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorlabelPattern
- the label pattern
-
assertNotSelectedValue
public void assertNotSelectedValue(java.lang.String selectLocator, java.lang.String valuePattern)
Asserts that no value of all selected options of the given select element matches the given pattern.- Specified by:
assertNotSelectedValue
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorvaluePattern
- the value pattern
-
assertNotStyle
public void assertNotStyle(java.lang.String elementLocator, java.lang.String styleText)
Asserts that the effective style of the element identified by the given element locator does NOT match the given style.- Specified by:
assertNotStyle
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorstyleText
- the style that must NOT match (e.g.width: 10px; overflow: hidden;
)
-
assertNotText
public void assertNotText(java.lang.String elementLocator, java.lang.String text)
Asserts that the embedded text of the given element does not contain the given text.- Specified by:
assertNotText
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the elementtext
- the text that should not be embedded in the given element
-
assertNotTextPresent
public void assertNotTextPresent(java.lang.String text)
Asserts that the given text is not present on the page.- Specified by:
assertNotTextPresent
in interfaceScriptCommands
- Parameters:
text
- the text that should NOT be present
-
assertNotTitle
public void assertNotTitle(java.lang.String title)
Asserts that the page title does not match the given title.- Specified by:
assertNotTitle
in interfaceScriptCommands
- Parameters:
title
- the title that should not match
-
assertNotValue
public void assertNotValue(java.lang.String elementLocator, java.lang.String value)
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.- Specified by:
assertNotValue
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element whose value doesn't match the given valuevalue
- the value that doesn't match the given element's value
-
assertNotVisible
public void assertNotVisible(java.lang.String elementLocator)
Asserts that the given element is invisible.- Specified by:
assertNotVisible
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locator.
-
assertNotXpathCount
public void assertNotXpathCount(java.lang.String xpath, int count)
Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.- Specified by:
assertNotXpathCount
in interfaceScriptCommands
- 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
public void assertNotXpathCount(java.lang.String xpath, java.lang.String count)
Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.- Specified by:
assertNotXpathCount
in interfaceScriptCommands
- 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
public void assertPageSize(long pageSize)
Asserts that the size of the actual page (including images etc.) does not exceed the given value.- Specified by:
assertPageSize
in interfaceScriptCommands
- Parameters:
pageSize
- the number of bytes the page size must not exceed
-
assertPageSize
public void assertPageSize(java.lang.String pageSize)
Asserts that the size of the actual page (including images etc.) does not exceed the given value.- Specified by:
assertPageSize
in interfaceScriptCommands
- Parameters:
pageSize
- the number of bytes the page size must not exceed
-
assertSelectedId
public void assertSelectedId(java.lang.String selectLocator, java.lang.String idPattern)
Asserts that the ID of at least one selected option of the given select element matches the given pattern.- Specified by:
assertSelectedId
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatoridPattern
- ID pattern
-
assertSelectedIndex
public void assertSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)
Asserts that the option of the given select element at the given index is selected.- Specified by:
assertSelectedIndex
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorindexPattern
- the option index pattern
-
assertSelectedLabel
public void assertSelectedLabel(java.lang.String selectLocator, java.lang.String labelPattern)
Asserts that the label of at least one selected option of the given select element matches the given pattern.- Specified by:
assertSelectedLabel
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorlabelPattern
- the label pattern
-
assertSelectedValue
public void assertSelectedValue(java.lang.String selectLocator, java.lang.String valuePattern)
Asserts that the value of at least one selected option of the given select element matches the given pattern.- Specified by:
assertSelectedValue
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorvaluePattern
- the value pattern
-
assertStyle
public void assertStyle(java.lang.String elementLocator, java.lang.String styleText)
Asserts that the effective style of the element identified by the given element locator matches the given style.- Specified by:
assertStyle
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorstyleText
- the style to match (e.g.width: 10px; overflow: hidden;
)
-
assertText
public void assertText(java.lang.String elementLocator, java.lang.String text)
Asserts that the text embedded by the given element contains the given text.- Specified by:
assertText
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element whose text should contain the given texttext
- the text that should be embedded in the given element
-
assertTextPresent
public void assertTextPresent(java.lang.String text)
Asserts that the given text is present.- Specified by:
assertTextPresent
in interfaceScriptCommands
- Parameters:
text
- the text that should be present
-
assertTitle
public void assertTitle(java.lang.String title)
Asserts that the given title matches the page title.- Specified by:
assertTitle
in interfaceScriptCommands
- Parameters:
title
- the title that should match the page title
-
assertValue
public void assertValue(java.lang.String elementLocator, java.lang.String value)
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.- Specified by:
assertValue
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element whose value should match the given valuevalue
- the value that should match the given element's value
-
assertVisible
public void assertVisible(java.lang.String elementLocator)
Asserts that the given element is visible.- Specified by:
assertVisible
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locator
-
assertXpathCount
public void assertXpathCount(java.lang.String xpath, int count)
Asserts that the number of elements locatable by the given XPath expression is equal to the given count.- Specified by:
assertXpathCount
in interfaceScriptCommands
- Parameters:
xpath
- the XPath expressioncount
- the number of elements that must match the given XPath expression
-
assertXpathCount
public void assertXpathCount(java.lang.String xpath, java.lang.String count)
Asserts that the number of elements locatable by the given XPath expression is equal to the given count.- Specified by:
assertXpathCount
in interfaceScriptCommands
- Parameters:
xpath
- the XPath expressioncount
- the number of elements that must match the given XPath expression
-
check
public void check(java.lang.String elementLocator)
Checks/toggles the given element.- Specified by:
check
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element to be checked/toggled
-
checkAndWait
public void checkAndWait(java.lang.String elementLocator)
Checks/toggles the given element and waits for some activity to complete.- Specified by:
checkAndWait
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element to be checked/toggled
-
click
public void click(java.lang.String elementLocator)
Clicks the given element.- Specified by:
click
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element to be clicked.
-
clickAndWait
public void clickAndWait(java.lang.String elementLocator)
Clicks the given element and waits for some activity to complete.- Specified by:
clickAndWait
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element to be clicked
-
close
public void close()
Closes the browser.- Specified by:
close
in interfaceScriptCommands
-
contextMenu
public void contextMenu(java.lang.String elementLocator)
Simulates a right-click on the given element.- Specified by:
contextMenu
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element to fire events at
-
contextMenuAt
public void contextMenuAt(java.lang.String elementLocator, java.lang.String coordinates)
Simulates a right-click at the given coordinates (relative to the given element).- Specified by:
contextMenuAt
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target elementcoordinates
- the coordinates relative to the given element
-
contextMenuAt
public void contextMenuAt(java.lang.String elementLocator, int coordX, int coordY)
Simulates a right-click at the given coordinates (relative to the given element).- Specified by:
contextMenuAt
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target elementcoordX
- the X coordinate relative to the given elementcoordY
- the Y coordinate relative to the given element
-
createCookie
public void createCookie(java.lang.String cookie)
Creates a new cookie. The new cookie will be stored as session cookie for the current path and domain.- Specified by:
createCookie
in interfaceScriptCommands
- Parameters:
cookie
- name value pair of the new cookie
-
createCookie
public void createCookie(java.lang.String cookie, java.lang.String options)
Creates a new cookie.- Specified by:
createCookie
in interfaceScriptCommands
- Parameters:
cookie
- name value pair of the new cookieoptions
- cookie creation options (path, max_age and domain)
-
deleteAllVisibleCookies
public void deleteAllVisibleCookies()
Removes all cookies visible to the current page.- Specified by:
deleteAllVisibleCookies
in interfaceScriptCommands
-
deleteCookie
public void deleteCookie(java.lang.String name)
Removes the cookie with the specified name.- Specified by:
deleteCookie
in interfaceScriptCommands
- Parameters:
name
- the cookie's name
-
deleteCookie
public void deleteCookie(java.lang.String name, java.lang.String options)
Removes the cookie with the specified name.- Specified by:
deleteCookie
in interfaceScriptCommands
- Parameters:
name
- the cookie's nameoptions
- cookie removal options (path, domain and recurse)
-
doubleClick
public void doubleClick(java.lang.String elementLocator)
Double-clicks the given element.- Specified by:
doubleClick
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element to be double-clicked
-
doubleClickAndWait
public void doubleClickAndWait(java.lang.String elementLocator)
Double-clicks the given element and waits for some activity to complete.- Specified by:
doubleClickAndWait
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element to be double-clicked
-
echo
public void echo(java.lang.String message)
Prints the given message to the log.- Specified by:
echo
in interfaceScriptCommands
- Parameters:
message
- the message to print
-
evaluate
public java.lang.String evaluate(java.lang.String jsExpression)
Returns the result of evaluating the given JavaScript expression.- Parameters:
jsExpression
- the JavaScript expression to evaluate- Returns:
- result of evaluation
-
evaluatesToTrue
public boolean evaluatesToTrue(java.lang.String jsExpression)
Returns whether or not the given expression evaluates totrue
.- Parameters:
jsExpression
- the JavaScript expression to evaluate- Returns:
true
if and only if the given JavaScript expression is not blank and evaluates totrue
-
findElement
public WebElement findElement(java.lang.String elementLocator)
Returns the first element matching the given locator.- Parameters:
elementLocator
- the element locator- Returns:
- first element matching the given locator
-
findElements
public java.util.List<WebElement> findElements(java.lang.String elementLocator)
Returns all elements that match the given locator.- Parameters:
elementLocator
- the element locator- Returns:
- all elements that were found for the given locator
-
getAttribute
public java.lang.String getAttribute(java.lang.String attributeLocator)
Returns the value of the given element attribute locator.- Parameters:
attributeLocator
- the element attribute locator- Returns:
- value of attribute specified by given element attribute locator
-
getAttribute
public java.lang.String getAttribute(java.lang.String elementLocator, java.lang.String attributeName)
Returns the value of the given element and attribute.- Parameters:
elementLocator
- the element locatorattributeName
- the name of the attribute- Returns:
- value of given element attribute locator
-
getElementCount
public int getElementCount(java.lang.String elementLocator)
Returns the number of matching elements.- Parameters:
elementLocator
- the element locator- Returns:
- number of elements matching the given locator
-
getPageText
public java.lang.String getPageText()
Returns the (visible) text of the current page.- Returns:
- the page's (visible) text
-
getText
public java.lang.String getText(java.lang.String elementLocator)
Returns the (visible) text of the given element. If the element is not visible, the empty string is returned.- Parameters:
elementLocator
- the element locator- Returns:
- the element's (visible) text
-
getTitle
public java.lang.String getTitle()
Returns the title of the current page.- Returns:
- page title
-
getValue
public java.lang.String getValue(java.lang.String elementLocator)
Returns the value of the given element. If the element doesn't have a value, the empty string is returned.- Parameters:
elementLocator
- the element locator- Returns:
- the element's value
-
getXpathCount
public int getXpathCount(java.lang.String xpath)
Returns the number of elements matching the given XPath expression.- Parameters:
xpath
- the XPath expression- Returns:
- number of matching elements
-
hasAttribute
public boolean hasAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Returns whether or not the value of the attribute identified by the given attribute locator matches the given text pattern.- Parameters:
attributeLocator
- the attribute locatortextPattern
- the text pattern- Returns:
true
if the attribute value matches the given pattern,false
otherwise
-
hasAttribute
public boolean hasAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)
Returns whether or not 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- Returns:
true
if the attribute value matches the given pattern,false
otherwise
-
hasClass
public boolean hasClass(java.lang.String elementLocator, java.lang.String clazz)
Returns whether or not the given element has the given class(es).- Parameters:
elementLocator
- the element locatorclazz
- the class string (multiple CSS classes separated by whitespace)- Returns:
true
if the element's class attribute contains all of the given class(es),false
otherwise- See Also:
CommonScriptCommands.hasClass(java.lang.String, java.lang.String)
-
hasNotClass
public boolean hasNotClass(java.lang.String elementLocator, java.lang.String clazz)
Returns whether or not the given element doesn't have the given class(es); that is, its class attribute doesn't contain any of the given class(es).- Parameters:
elementLocator
-clazz
- the class string (multiple CSS classes separated by whitespace)- Returns:
true
if the element's class attribute does not contains any of the given class(es),false
otherwise
-
hasNotStyle
public boolean hasNotStyle(java.lang.String elementLocator, java.lang.String style)
Returns whether or not the given element doesn't have the given style; that is, none of the given CSS properties must match the element's actual style.- Parameters:
elementLocator
- the element locatorstyle
- the CSS style text to check (e.g.width: 10px; overflow: hidden;
)- Returns:
true
if NONE of the given CSS properties match the element's actual style,false
otherwise
-
hasStyle
public boolean hasStyle(java.lang.String elementLocator, java.lang.String style)
Returns whether or not the given element has the given style; that is, all of the given CSS properties must match the element's actual style.- Parameters:
elementLocator
- the element locatorstyle
- the CSS style text to check (e.g.width: 10px; overflow: hidden;
)- Returns:
true
if ALL of the given CSS properties match the elements actual style,false
otherwise
-
hasText
public boolean hasText(java.lang.String elementLocator, java.lang.String textPattern)
Checks that the text embedded by the given element contains the given text.- Parameters:
elementLocator
- locator identifying the element whose text should contain the given texttextPattern
- the text that should be embedded in the given element- Returns:
true
if the text embedded by the given element contains the given text,false
otherwise
-
hasTitle
public boolean hasTitle(java.lang.String title)
Checks that the given title matches the page title.- Parameters:
title
- the title that should match the page title- Returns:
true
if the given title matches the page title,false
otherwise
-
hasValue
public boolean hasValue(java.lang.String elementLocator, java.lang.String valuePattern)
Checks that the value of the given element matches the given value. If the element is a <textarea> this method checks 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- Returns:
true
if the value of the given element matches the given value,false
otherwise
-
isChecked
public boolean isChecked(java.lang.String elementLocator)
Returns whether or not the element identified by the given element locator is checked.- Parameters:
elementLocator
- the element locator- Returns:
true
if the element identified by the given element locator is checked,false
otherwise
-
isElementPresent
public boolean isElementPresent(java.lang.String elementLocator)
Returns whether or not there is an element for the given locator.- Parameters:
elementLocator
- the element locator- Returns:
true
if there at least one element has been found for the given locator,false
otherwise
-
isEnabled
public boolean isEnabled(java.lang.String elementLocator)
Returns whether or not the given element is enabled.- Parameters:
elementLocator
- the element locator- Returns:
true
if the element identified by the given element locator is enabled,false
otherwise
-
isEvalMatching
public boolean isEvalMatching(java.lang.String expression, java.lang.String textPattern)
Returns whether or not the result of evaluating the given expression matches the given text pattern.- Parameters:
expression
- the JavaScript expression to evaluatetextPattern
- the text pattern- Returns:
true
if the evaluation result matches the given pattern,false
otherwise
-
isTextPresent
public boolean isTextPresent(java.lang.String textPattern)
Checks that the given text is present.- Parameters:
textPattern
- the text that should be present- Returns:
true
if the given text is present,false
otherwise
-
isVisible
public boolean isVisible(java.lang.String elementLocator)
Returns whether or not the given element is visible.- Parameters:
elementLocator
- the element locator- Returns:
true
if element was found and is visible,false
otherwise
-
mouseDown
public void mouseDown(java.lang.String elementLocator)
Presses the left mouse button on an element, but does not release the button yet.- Specified by:
mouseDown
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target element
-
mouseDownAt
public void mouseDownAt(java.lang.String elementLocator, java.lang.String coordinates)
Presses the left mouse button at the given coordinates (relative to the given element), but does not release the button yet.- Specified by:
mouseDownAt
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target elementcoordinates
- the coordinates relative to the given element
-
mouseDownAt
public void mouseDownAt(java.lang.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.- Specified by:
mouseDownAt
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target elementcoordX
- the X coordinate relative to the given elementcoordY
- the Y coordinate relative to the given element
-
mouseMove
public void mouseMove(java.lang.String elementLocator)
Moves the mouse to the given element.- Specified by:
mouseMove
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target element
-
mouseMoveAt
public void mouseMoveAt(java.lang.String elementLocator, java.lang.String coordinates)
Moves the mouse to the given coordinates (relative to the given element).- Specified by:
mouseMoveAt
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target elementcoordinates
- the coordinates relative to the given element
-
mouseMoveAt
public void mouseMoveAt(java.lang.String elementLocator, int coordX, int coordY)
Moves the mouse to the given coordinates (relative to the given element).- Specified by:
mouseMoveAt
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target elementcoordX
- the X coordinate relative to the given elementcoordY
- the Y coordinate relative to the given element
-
mouseOut
public void mouseOut(java.lang.String elementLocator)
Moves the mouse out of the element's bounding box.- Specified by:
mouseOut
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target element
-
mouseOver
public void mouseOver(java.lang.String elementLocator)
Hovers the mouse over an element.- Specified by:
mouseOver
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target element
-
mouseUp
public void mouseUp(java.lang.String elementLocator)
Releases the left mouse button on an element.- Specified by:
mouseUp
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target element
-
mouseUpAt
public void mouseUpAt(java.lang.String elementLocator, java.lang.String coordinates)
Releases the left mouse button at the given coordinates (relative to the given element).- Specified by:
mouseUpAt
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target elementcoordinates
- the coordinates relative to the given element
-
mouseUpAt
public void mouseUpAt(java.lang.String elementLocator, int coordX, int coordY)
Releases the left mouse button at the given coordinates (relative to the given element).- Specified by:
mouseUpAt
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the target elementcoordX
- the X coordinate relative to the given elementcoordY
- the Y coordinate relative to the given element
-
open
public void open(java.lang.String pageUrlString)
Opens the given URL.- Specified by:
open
in interfaceScriptCommands
- Parameters:
pageUrlString
- the URL to open
-
open
public void open(java.net.URL url)
Opens the given URL.- Parameters:
url
- url the target URL
-
pause
public void pause(long waitingTime)
Waits the given time.- Specified by:
pause
in interfaceScriptCommands
- Parameters:
waitingTime
- the time in milliseconds to wait
-
pause
public void pause(java.lang.String waitingTime)
Waits the given time.- Specified by:
pause
in interfaceScriptCommands
- Parameters:
waitingTime
- the time in milliseconds to wait
-
removeSelection
public void removeSelection(java.lang.String select, java.lang.String option)
Removes the given option of the given select from the current selection.- Specified by:
removeSelection
in interfaceScriptCommands
- Parameters:
select
- the selectoption
- the option to be removed from the current selection
-
resolve
public java.lang.String resolve(java.lang.String resolvable)
Resolves the given string.- Parameters:
resolvable
- the resolvable string containing one or more test data placeholders- Returns:
- resolved string
-
resolveKey
public java.lang.String resolveKey(java.lang.String key)
Resolves the given test data key- Parameters:
key
- the key string containing only the name of a test data field- Returns:
- resolved string or
null
if not found
-
select
public void select(java.lang.String select, java.lang.String option)
Selects the given option of the given select.- Specified by:
select
in interfaceScriptCommands
- Parameters:
select
- the selectoption
- the option to select
-
selectAndWait
public void selectAndWait(java.lang.String select, java.lang.String option)
Selects the given option of the given select and waits for some activity to complete.- Specified by:
selectAndWait
in interfaceScriptCommands
- Parameters:
select
- the selectoption
- the option to select
-
selectFrame
public void selectFrame(java.lang.String frameTarget)
Selects the given frame.- Specified by:
selectFrame
in interfaceScriptCommands
- Parameters:
frameTarget
- the frame to be selected
-
selectWindow
public void selectWindow()
Selects the top-level window.- Specified by:
selectWindow
in interfaceScriptCommands
-
selectWindow
public void selectWindow(java.lang.String windowTarget)
Selects the given window.- Specified by:
selectWindow
in interfaceScriptCommands
- Parameters:
windowTarget
- the window to be selected
-
setTimeout
public void setTimeout(long timeout)
Sets the timeout to the given value.- Specified by:
setTimeout
in interfaceScriptCommands
- Parameters:
timeout
- the new timeout in milliseconds
-
setTimeout
public void setTimeout(java.lang.String timeout)
Sets the timeout to the given value.- Specified by:
setTimeout
in interfaceScriptCommands
- Parameters:
timeout
- the new timeout in milliseconds
-
startAction
public void startAction(java.lang.String actionName)
Starts a new action using the given name.- Specified by:
startAction
in interfaceScriptCommands
- Parameters:
actionName
- the name of the action
-
stopAction
public void stopAction()
Stops the current action.- See Also:
startAction(String)
-
store
public void store(java.lang.String text, java.lang.String variableName)
Stores the given text to the given variable.- Specified by:
store
in interfaceScriptCommands
- Parameters:
text
- the text to storevariableName
- the variable name
-
storeAttribute
public void storeAttribute(java.lang.String attributeLocator, java.lang.String variableName)
Stores the value of the attribute identified by the given attribute locator to the given variable- Specified by:
storeAttribute
in interfaceScriptCommands
- Parameters:
attributeLocator
- the attribute locatorvariableName
- the variable name
-
storeAttribute
public void storeAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String variableName)
Stores the value of the given element and attribute to the given variable.- Specified by:
storeAttribute
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorattributeName
- the name of the attributevariableName
- the variable name
-
storeElementCount
public void storeElementCount(java.lang.String elementLocator, java.lang.String variableName)
Stores that the number of elements found by using the given element locator to the given variable.- Specified by:
storeElementCount
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorvariableName
- the variable name
-
storeEval
public void storeEval(java.lang.String expression, java.lang.String variableName)
Stores the result of evaluating the given expression to the given variable.- Specified by:
storeEval
in interfaceScriptCommands
- Parameters:
expression
- the expression to evaluatevariableName
- the variable name
-
storeText
public void storeText(java.lang.String elementLocator, java.lang.String variableName)
Stores the text of the element identified by the given locator to the given variable.- Specified by:
storeText
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorvariableName
- the variable
-
storeTitle
public void storeTitle(java.lang.String variableName)
Stores the title of the currently active document to the given variable.- Specified by:
storeTitle
in interfaceScriptCommands
- Parameters:
variableName
- the variable
-
storeValue
public void storeValue(java.lang.String elementLocator, java.lang.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.- Specified by:
storeValue
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorvariableName
- the variable
-
storeXpathCount
public void storeXpathCount(java.lang.String xpath, java.lang.String variableName)
Stores the number of elements matching the given XPath expression to the given variable.- Specified by:
storeXpathCount
in interfaceScriptCommands
- Parameters:
xpath
- the XPath expressionvariableName
- the variable
-
submit
public void submit(java.lang.String form)
Submits the given form.- Specified by:
submit
in interfaceScriptCommands
- Parameters:
form
- the form to submit
-
submitAndWait
public void submitAndWait(java.lang.String form)
Submits the given form and waits for some activity to complete.- Specified by:
submitAndWait
in interfaceScriptCommands
- Parameters:
form
- the form to submit
-
type
public void type(java.lang.String elementLocator, java.lang.String text)
Types the given text into the given input field.- Specified by:
type
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the input fieldtext
- the text to be typed
-
typeAndWait
public void typeAndWait(java.lang.String elementLocator, java.lang.String text)
Types the given text into the given input field and waits for some activity to complete.- Specified by:
typeAndWait
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the input fieldtext
- the text to be typed
-
uncheck
public void uncheck(java.lang.String elementLocator)
Unchecks the given checkbox/radio button.- Specified by:
uncheck
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the checkbox/radio button
-
uncheckAndWait
public void uncheckAndWait(java.lang.String elementLocator)
Unchecks the given checkbox/radio button and waits for a page load.- Specified by:
uncheckAndWait
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the checkbox/radio button
-
waitForAttribute
public void waitForAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.- Specified by:
waitForAttribute
in interfaceScriptCommands
- Parameters:
attributeLocator
- the attribute locatortextPattern
- the text pattern
-
waitForAttribute
public void waitForAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)
Waits until the value of the given element and attribute matches the given text pattern.- Specified by:
waitForAttribute
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorattributeName
- the name of the attributetextPattern
- the text pattern
-
waitForChecked
public void waitForChecked(java.lang.String elementLocator)
Waits until the given checkbox/radio button becomes checked.- Specified by:
waitForChecked
in interfaceScriptCommands
- Parameters:
elementLocator
- the checkbox/radio button element locator
-
waitForClass
public void waitForClass(java.lang.String elementLocator, java.lang.String clazzString)
Waits until the given element has the given class(es).- Specified by:
waitForClass
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorclazzString
- the class(es) string
-
waitForElementCount
public void waitForElementCount(java.lang.String elementLocator, int count)
Waits until the number of elements found by using the given element locator is equal to the given count.- Specified by:
waitForElementCount
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorcount
- the number of elements
-
waitForElementCount
public void waitForElementCount(java.lang.String elementLocator, java.lang.String count)
Waits until the number of elements found by using the given element locator is equal to the given count.- Specified by:
waitForElementCount
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorcount
- the number of elements
-
waitForElementPresent
public void waitForElementPresent(java.lang.String elementLocator)
Waits for the given element to appear.- Specified by:
waitForElementPresent
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element to wait for
-
waitForEval
public void waitForEval(java.lang.String expression, java.lang.String textPattern)
Waits until the result of evaluating the given expression matches the given text pattern.- Specified by:
waitForEval
in interfaceScriptCommands
- Parameters:
expression
- the expression to evaluatetextPattern
- textPattern the text pattern the evaluation result must match
-
waitForNotAttribute
public void waitForNotAttribute(java.lang.String attributeLocator, java.lang.String textPattern)
Waits until the value of the attribute identified by the given attribute locator does NOT match the given text pattern.- Specified by:
waitForNotAttribute
in interfaceScriptCommands
- Parameters:
attributeLocator
- the attribute locatortextPattern
- the text pattern that must NOT match
-
waitForNotAttribute
public void waitForNotAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)
Waits until the value of the given element and attribute does NOT match the given text pattern.- Specified by:
waitForNotAttribute
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorattributeName
- the name of the attributetextPattern
- the text pattern
-
waitForNotChecked
public void waitForNotChecked(java.lang.String elementLocator)
Waits until the given checkbox/radio button becomes unchecked.- Specified by:
waitForNotChecked
in interfaceScriptCommands
- Parameters:
elementLocator
- the checkbox/radio button element locator
-
waitForNotClass
public void waitForNotClass(java.lang.String elementLocator, java.lang.String clazzString)
Waits until the given element doesn't have the given class(es).- Specified by:
waitForNotClass
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorclazzString
- the class(es) string
-
waitForNotElementCount
public void waitForNotElementCount(java.lang.String elementLocator, int count)
Waits until the number of elements found by using the given element locator is unequal to the given count.- Specified by:
waitForNotElementCount
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorcount
- the number of elements
-
waitForNotElementCount
public void waitForNotElementCount(java.lang.String elementLocator, java.lang.String count)
Waits until the number of elements found by using the given element locator is unequal to the given count.- Specified by:
waitForNotElementCount
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorcount
- the number of elements
-
waitForNotElementPresent
public void waitForNotElementPresent(java.lang.String elementLocator)
Waits for the given element to disappear.- Specified by:
waitForNotElementPresent
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element to disappear
-
waitForNotEval
public void waitForNotEval(java.lang.String expression, java.lang.String textPattern)
Waits until the result of evaluating the given expression does NOT match the given text pattern.- Specified by:
waitForNotEval
in interfaceScriptCommands
- Parameters:
expression
- the expression to evaluatetextPattern
- the text pattern that the evaluation result must NOT match
-
waitForNotSelectedId
public void waitForNotSelectedId(java.lang.String selectLocator, java.lang.String idPattern)
Waits until no ID of all selected options of the given select matches the given pattern.- Specified by:
waitForNotSelectedId
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatoridPattern
- the ID pattern
-
waitForNotSelectedIndex
public void waitForNotSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)
Waits until the option of the given select element at the given index is not selected.- Specified by:
waitForNotSelectedIndex
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorindexPattern
- the option index pattern
-
waitForNotSelectedLabel
public void waitForNotSelectedLabel(java.lang.String selectLocator, java.lang.String labelPattern)
Waits until no label of all selected options of the given select matches the given pattern.- Specified by:
waitForNotSelectedLabel
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorlabelPattern
- the label pattern
-
waitForNotSelectedValue
public void waitForNotSelectedValue(java.lang.String selectLocator, java.lang.String valuePattern)
Waits until no value of all selected options of the given select matches the given pattern.- Specified by:
waitForNotSelectedValue
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorvaluePattern
- the value pattern
-
waitForNotStyle
public void waitForNotStyle(java.lang.String elementLocator, java.lang.String styleText)
Waits until the effective style of the element identified by the given element locator does NOT match the given style.- Specified by:
waitForNotStyle
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorstyleText
- the style that must NOT match (e.g.width: 10px; overflow: hidden;
)
-
waitForNotText
public void waitForNotText(java.lang.String elementLocator, java.lang.String text)
Waits for the given text embedded in the given element to disappear/change.- Specified by:
waitForNotText
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element whose embedded text should changetext
- the text that should change/disappear
-
waitForNotTextPresent
public void waitForNotTextPresent(java.lang.String text)
Waits for the given text to disappear/change.- Specified by:
waitForNotTextPresent
in interfaceScriptCommands
- Parameters:
text
- the text that should disappear/change
-
waitForNotTitle
public void waitForNotTitle(java.lang.String title)
Waits for the given page title change.- Specified by:
waitForNotTitle
in interfaceScriptCommands
- Parameters:
title
- the page title that should change
-
waitForNotValue
public void waitForNotValue(java.lang.String elementLocator, java.lang.String value)
Waits for the given value in the given element to disappear/change.- Specified by:
waitForNotValue
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element whose value should changevalue
- the value that should change/disappear
-
waitForNotVisible
public void waitForNotVisible(java.lang.String elementLocator)
Waits until the given element becomes invisible.- Specified by:
waitForNotVisible
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locator
-
waitForNotXpathCount
public void waitForNotXpathCount(java.lang.String xpath, int count)
Waits for the number of elements matching the given XPath expression change to a different value than the given one.- Specified by:
waitForNotXpathCount
in interfaceScriptCommands
- Parameters:
xpath
- the XPath expressioncount
- the number of elements currently matching the given XPath expression
-
waitForNotXpathCount
public void waitForNotXpathCount(java.lang.String xpath, java.lang.String count)
Waits for the number of elements matching the given XPath expression change to a different value than the given one.- Specified by:
waitForNotXpathCount
in interfaceScriptCommands
- Parameters:
xpath
- the XPath expressioncount
- the number of elements currently matching the given XPath expression
-
waitForPageToLoad
public void waitForPageToLoad()
Waits for the page to be loaded completely.- Specified by:
waitForPageToLoad
in interfaceScriptCommands
-
waitForPopUp
public void waitForPopUp()
Waits for any pop-up window to be loaded completely.- Specified by:
waitForPopUp
in interfaceScriptCommands
-
waitForPopUp
public void waitForPopUp(java.lang.String windowID)
Waits for some pop-up window to be loaded completely.- Specified by:
waitForPopUp
in interfaceScriptCommands
- Parameters:
windowID
- the ID of the window to wait for
-
waitForPopUp
public void waitForPopUp(java.lang.String windowID, long maxWaitingTime)
Waits at most the given time for some pop-up window to be loaded completely.- Specified by:
waitForPopUp
in interfaceScriptCommands
- Parameters:
windowID
- the ID of the window to wait formaxWaitingTime
- the maximum waiting time
-
waitForPopUp
public void waitForPopUp(java.lang.String windowID, java.lang.String maxWaitingTime)
Waits at most the given time for some pop-up window to be loaded completely.- Specified by:
waitForPopUp
in interfaceScriptCommands
- Parameters:
windowID
- the ID of the window to wait formaxWaitingTime
- the maximum waiting time
-
waitForSelectedId
public void waitForSelectedId(java.lang.String selectLocator, java.lang.String idPattern)
Waits until the ID of at least one selected option of the given select matches the given pattern.- Specified by:
waitForSelectedId
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatoridPattern
- the ID pattern
-
waitForSelectedIndex
public void waitForSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)
Waits until the option of the given select at the given index is selected.- Specified by:
waitForSelectedIndex
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorindexPattern
- the option index pattern
-
waitForSelectedLabel
public void waitForSelectedLabel(java.lang.String selectLocator, java.lang.String labelPattern)
Waits until the label of at least one selected option of the given select matches the given pattern.- Specified by:
waitForSelectedLabel
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorlabelPattern
- the label pattern
-
waitForSelectedValue
public void waitForSelectedValue(java.lang.String selectLocator, java.lang.String valuePattern)
Waits until the value of at least one selected option of the given select matches the given pattern.- Specified by:
waitForSelectedValue
in interfaceScriptCommands
- Parameters:
selectLocator
- the select element locatorvaluePattern
- the value pattern
-
waitForStyle
public void waitForStyle(java.lang.String elementLocator, java.lang.String styleText)
Waits until the effective style of the element identified by the given element locator matches the given style.- Specified by:
waitForStyle
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locatorstyleText
- the style that must match (e.g.width: 10px; overflow: hidden;
)
-
waitForText
public void waitForText(java.lang.String elementLocator, java.lang.String text)
Waits for the given text embedded in the given element.- Specified by:
waitForText
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element whose text should contain the given texttext
- the text to wait for
-
waitForTextPresent
public void waitForTextPresent(java.lang.String text)
Waits for the given text to appear.- Specified by:
waitForTextPresent
in interfaceScriptCommands
- Parameters:
text
- the text to wait for
-
waitForTitle
public void waitForTitle(java.lang.String title)
Waits for the given page title.- Specified by:
waitForTitle
in interfaceScriptCommands
- Parameters:
title
- the page title to wait for
-
waitForValue
public void waitForValue(java.lang.String elementLocator, java.lang.String value)
Waits for the given value in the given element.- Specified by:
waitForValue
in interfaceScriptCommands
- Parameters:
elementLocator
- locator identifying the element whose value should match the given valuevalue
- the value to wait for
-
waitForVisible
public void waitForVisible(java.lang.String elementLocator)
Waits until the given element becomes visible.- Specified by:
waitForVisible
in interfaceScriptCommands
- Parameters:
elementLocator
- the element locator
-
waitForXpathCount
public void waitForXpathCount(java.lang.String xpath, int count)
Waits for the number of elements matching the given XPath expression is equal to the given count.- Specified by:
waitForXpathCount
in interfaceScriptCommands
- Parameters:
xpath
- the XPath expressioncount
- the number of elements to wait for
-
waitForXpathCount
public void waitForXpathCount(java.lang.String xpath, java.lang.String count)
Waits for the number of elements matching the given XPath expression is equal to the given count.- Specified by:
waitForXpathCount
in interfaceScriptCommands
- Parameters:
xpath
- the XPath expressioncount
- the number of elements to wait for
-
__cleanUpAbstractWebDriverScriptTestCase
public final void __cleanUpAbstractWebDriverScriptTestCase()
Performs additional cleanup tasks for WebDriver-based exported script test cases. Don't call this method directly, it will be called implicitly by the JUnit framework.
-
__setUpAbstractWebDriverScriptTestCase
public final void __setUpAbstractWebDriverScriptTestCase()
Performs additional setup tasks for WebDriver-based exported script test cases. Don't call this method directly, it will be called implicitly by the JUnit framework.
-
-