Class StaticScriptCommands
- java.lang.Object
-
- com.xceptance.xlt.api.engine.scripting.StaticScriptCommands
-
public class StaticScriptCommands extends java.lang.ObjectStatic versions of the Selenium-like commands supported by the XLT framework and the script developer. Inherit from this class or import its methods statically to get access to all script commands from any class, not just from subclasses ofAbstractWebDriverScriptTestCaseorAbstractWebDriverModule.This class was introduced mainly to allow for other ways of structuring your reusable code than having to extend
AbstractWebDriverModule. For example, traditionally separate module classes could now be turned into (static) methods of a special helper class.Even though the methods of this class can now be used from everywhere, the scripting engine still needs to be set up correctly before the test and shut down afterwards. That is why for the time being your test case class still needs to be a subclass of
AbstractWebDriverScriptTestCaseas it prepares everything as needed.- See Also:
ScriptCommands
-
-
Constructor Summary
Constructors Constructor Description StaticScriptCommands()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddSelection(java.lang.String select, java.lang.String option)Adds the given option of the given select to the current selection.static voidassertAttribute(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.static voidassertAttribute(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.static voidassertChecked(java.lang.String elementLocator)Asserts that the given checkbox/radio button is checked.static voidassertClass(java.lang.String elementLocator, java.lang.String clazzString)Asserts that the given element has the given class(es).static voidassertElementCount(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.static voidassertElementCount(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.static voidassertElementPresent(java.lang.String elementLocator)Asserts that the given element is present.static voidassertEval(java.lang.String expression, java.lang.String textPattern)Asserts that evaluating the given expression matches the given text pattern.static voidassertLoadTime(long loadTime)Asserts that the time needed to load a page does not exceed the given value.static voidassertLoadTime(java.lang.String loadTime)Asserts that the time needed to load a page does not exceed the given value.static voidassertNotAttribute(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.static voidassertNotAttribute(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.static voidassertNotChecked(java.lang.String elementLocator)Asserts that the given checkbox/radio button is unchecked.static voidassertNotClass(java.lang.String elementLocator, java.lang.String clazzString)Asserts that the given element doesn't have the given class(es).static voidassertNotElementCount(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.static voidassertNotElementCount(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.static voidassertNotElementPresent(java.lang.String elementLocator)Asserts that the given element is not present.static voidassertNotEval(java.lang.String expression, java.lang.String textPattern)Asserts that evaluating the given expression does NOT match the given text pattern.static voidassertNotSelectedId(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.static voidassertNotSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)Asserts that the option of the given select element at the given index is not selected.static voidassertNotSelectedLabel(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.static voidassertNotSelectedValue(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.static voidassertNotStyle(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.static voidassertNotText(java.lang.String elementLocator, java.lang.String text)Asserts that the embedded text of the given element does not contain the given text.static voidassertNotTextPresent(java.lang.String text)Asserts that the given text is not present on the page.static voidassertNotTitle(java.lang.String title)Asserts that the page title does not match the given title.static voidassertNotValue(java.lang.String elementLocator, java.lang.String valuePattern)Asserts that the value of the given element doesn't match the given value.static voidassertNotVisible(java.lang.String elementLocator)Asserts that the given element is invisible.static voidassertNotXpathCount(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.static voidassertNotXpathCount(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.static voidassertPageSize(long pageSize)Asserts that the size of the actual page (including images etc.) does not exceed the given value.static voidassertPageSize(java.lang.String pageSize)Asserts that the size of the actual page (including images etc.) does not exceed the given value.static voidassertSelectedId(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.static voidassertSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)Asserts that the option of the given select element at the given index is selected.static voidassertSelectedLabel(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.static voidassertSelectedValue(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.static voidassertStyle(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.static voidassertText(java.lang.String elementLocator, java.lang.String text)Asserts that the text embedded by the given element contains the given text.static voidassertTextPresent(java.lang.String text)Asserts that the given text is present.static voidassertTitle(java.lang.String title)Asserts that the given title matches the page title.static voidassertValue(java.lang.String elementLocator, java.lang.String valuePattern)Asserts that the value of the given element matches the given value.static voidassertVisible(java.lang.String elementLocator)Asserts that the given element is visible.static voidassertXpathCount(java.lang.String xpath, int count)Asserts that the number of elements locatable by the given XPath expression is equal to the given count.static voidassertXpathCount(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.static voidcheck(java.lang.String elementLocator)Checks/toggles the given element.static voidcheckAndWait(java.lang.String elementLocator)Checks/toggles the given element and waits for some activity to complete.static voidclick(java.lang.String elementLocator)Clicks the given element.static voidclickAndWait(java.lang.String elementLocator)Clicks the given element and waits for some activity to complete.static voidclose()Closes the browser.static voidcontextMenu(java.lang.String elementLocator)Simulates a right-click on the given element.static voidcontextMenuAt(java.lang.String elementLocator, int coordX, int coordY)Simulates a right-click at the given coordinates (relative to the given element).static voidcontextMenuAt(java.lang.String elementLocator, java.lang.String coordinates)Simulates a right-click at the given coordinates (relative to the given element).static voidcreateCookie(java.lang.String cookie)Creates a new cookie.static voidcreateCookie(java.lang.String cookie, java.lang.String options)Creates a new cookie.static voiddeleteAllVisibleCookies()Removes all cookies visible to the current page.static voiddeleteCookie(java.lang.String name)Removes the cookie with the specified name.static voiddeleteCookie(java.lang.String name, java.lang.String options)Removes the cookie with the specified name.static voiddoubleClick(java.lang.String elementLocator)Double-clicks the given element.static voiddoubleClickAndWait(java.lang.String elementLocator)Double-clicks the given element and waits for some activity to complete.static voidecho(java.lang.String message)Prints the given message to the log.static java.lang.Stringevaluate(java.lang.String jsExpression)Returns the result of evaluating the given JavaScript expression.static booleanevaluatesToTrue(java.lang.String jsExpression)Returns whether or not the given expression evaluates totrue.static WebElementfindElement(java.lang.String elementLocator)Returns the first element matching the given locator.static java.util.List<WebElement>findElements(java.lang.String elementLocator)Returns all elements that match the given locator.static java.lang.StringgetAttribute(java.lang.String attributeLocator)Returns the value of the given element attribute locator.static java.lang.StringgetAttribute(java.lang.String elementLocator, java.lang.String attributeName)Returns the value of the given element and attribute.static intgetElementCount(java.lang.String elementLocator)Returns the number of matching elements.static java.lang.StringgetPageText()Returns the (visible) text of the current page.static java.lang.StringgetText(java.lang.String elementLocator)Returns the (visible) text of the given element.static java.lang.StringgetTitle()Returns the title of the current page.static java.lang.StringgetValue(java.lang.String elementLocator)Returns the value of the given element.static WebDrivergetWebDriver()Returns the webdriver instance.static intgetXpathCount(java.lang.String xpath)Returns the number of elements matching the given XPath expression.static booleanhasAttribute(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.static booleanhasAttribute(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.static booleanhasClass(java.lang.String elementLocator, java.lang.String clazz)Returns whether or not the given element has the given class(es).static booleanhasNotClass(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).static booleanhasNotStyle(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.static booleanhasStyle(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.static booleanhasText(java.lang.String elementLocator, java.lang.String textPattern)Checks that the text embedded by the given element contains the given text.static booleanhasTitle(java.lang.String title)Checks that the given title matches the page title.static booleanhasValue(java.lang.String elementLocator, java.lang.String valuePattern)Checks that the value of the given element matches the given value.static booleanisChecked(java.lang.String elementLocator)Returns whether or not the element identified by the given element locator is checked.static booleanisElementPresent(java.lang.String elementLocator)Returns whether or not there is an element for the given locator.static booleanisEnabled(java.lang.String elementLocator)Returns whether or not the given element is enabled.static booleanisEvalMatching(java.lang.String expression, java.lang.String textPattern)Returns whether or not the result of evaluating the given expression matches the given text pattern.static booleanisTextPresent(java.lang.String textPattern)Checks that the given text is present.static booleanisVisible(java.lang.String elementLocator)Returns whether or not the given element is visible.static voidmouseDown(java.lang.String elementLocator)Presses the left mouse button on an element, but does not release the button yet.static voidmouseDownAt(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.static voidmouseDownAt(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.static voidmouseMove(java.lang.String elementLocator)Moves the mouse to the given element.static voidmouseMoveAt(java.lang.String elementLocator, int coordX, int coordY)Moves the mouse to the given coordinates (relative to the given element).static voidmouseMoveAt(java.lang.String elementLocator, java.lang.String coordinates)Moves the mouse to the given coordinates (relative to the given element).static voidmouseOut(java.lang.String elementLocator)Moves the mouse out of the element's bounding box.static voidmouseOver(java.lang.String elementLocator)Hovers the mouse over an element.static voidmouseUp(java.lang.String elementLocator)Releases the left mouse button on an element.static voidmouseUpAt(java.lang.String elementLocator, int coordX, int coordY)Releases the left mouse button at the given coordinates (relative to the given element).static voidmouseUpAt(java.lang.String elementLocator, java.lang.String coordinates)Releases the left mouse button at the given coordinates (relative to the given element).static voidopen(java.lang.String pageUrlString)Opens the given URL.static voidpause(long waitingTime)Waits the given time.static voidpause(java.lang.String waitingTime)Waits the given time.static voidremoveSelection(java.lang.String select, java.lang.String option)Removes the given option of the given select from the current selection.static java.lang.Stringresolve(java.lang.String resolvable)Resolves the given string.static java.lang.StringresolveKey(java.lang.String key)Resolves the given test data keystatic voidselect(java.lang.String select, java.lang.String option)Selects the given option of the given select.static voidselectAndWait(java.lang.String select, java.lang.String option)Selects the given option of the given select and waits for some activity to complete.static voidselectFrame(java.lang.String frameTarget)Selects the given frame.static voidselectWindow()Selects the top-level window.static voidselectWindow(java.lang.String windowTarget)Selects the given window.static voidsetTimeout(long timeout)Sets the timeout to the given value.static voidsetTimeout(java.lang.String timeout)Sets the timeout to the given value.static voidstartAction(java.lang.String actionName)Starts a new action using the given name.static voidstopAction()Stops the current action.static voidstore(java.lang.String text, java.lang.String variableName)Stores the given text to the given variable.static voidstoreAttribute(java.lang.String attributeLocator, java.lang.String variableName)Stores the value of the attribute identified by the given attribute locator to the given variablestatic voidstoreAttribute(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.static voidstoreElementCount(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.static voidstoreEval(java.lang.String expression, java.lang.String variableName)Stores the result of evaluating the given expression to the given variable.static voidstoreText(java.lang.String elementLocator, java.lang.String variableName)Stores the text of the element identified by the given locator to the given variable.static voidstoreTitle(java.lang.String variableName)Stores the title of the currently active document to the given variable.static voidstoreValue(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.static voidstoreXpathCount(java.lang.String xpath, java.lang.String variableName)Stores the number of elements matching the given XPath expression to the given variable.static voidsubmit(java.lang.String form)Submits the given form.static voidsubmitAndWait(java.lang.String form)Submits the given form and waits for some activity to complete.static voidtype(java.lang.String elementLocator, java.lang.String text)Types the given text into the given input field.static voidtypeAndWait(java.lang.String elementLocator, java.lang.String text)Types the given text into the given input field and waits for some activity to complete.static voiduncheck(java.lang.String elementLocator)Unchecks the given checkbox/radio button.static voiduncheckAndWait(java.lang.String elementLocator)Unchecks the given checkbox/radio button and waits for a page load.static voidwaitForAttribute(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.static voidwaitForAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.static voidwaitForChecked(java.lang.String elementLocator)Waits until the given checkbox/radio button becomes checked.static voidwaitForClass(java.lang.String elementLocator, java.lang.String clazzString)Waits until the given element has the given class(es).static voidwaitForElementCount(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.static voidwaitForElementCount(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.static voidwaitForElementPresent(java.lang.String elementLocator)Waits for the given element to appear.static voidwaitForEval(java.lang.String expression, java.lang.String textPattern)Waits until the result of evaluating the given expression matches the given text pattern.static voidwaitForNotAttribute(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.static voidwaitForNotAttribute(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.static voidwaitForNotChecked(java.lang.String elementLocator)Waits until the given checkbox/radio button becomes unchecked.static voidwaitForNotClass(java.lang.String elementLocator, java.lang.String clazzString)Waits until the given element doesn't have the given class(es).static voidwaitForNotElementCount(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.static voidwaitForNotElementCount(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.static voidwaitForNotElementPresent(java.lang.String elementLocator)Waits for the given element to disappear.static voidwaitForNotEval(java.lang.String expression, java.lang.String textPattern)Waits until the result of evaluating the given expression does NOT match the given text pattern.static voidwaitForNotSelectedId(java.lang.String selectLocator, java.lang.String idPattern)Waits until no ID of all selected options of the given select matches the given pattern.static voidwaitForNotSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)Waits until the option of the given select element at the given index is not selected.static voidwaitForNotSelectedLabel(java.lang.String selectLocator, java.lang.String labelPattern)Waits until no label of all selected options of the given select matches the given pattern.static voidwaitForNotSelectedValue(java.lang.String selectLocator, java.lang.String valuePattern)Waits until no value of all selected options of the given select matches the given pattern.static voidwaitForNotStyle(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.static voidwaitForNotText(java.lang.String elementLocator, java.lang.String text)Waits for the given text embedded in the given element to disappear/change.static voidwaitForNotTextPresent(java.lang.String text)Waits for the given text to disappear/change.static voidwaitForNotTitle(java.lang.String title)Waits for the given page title change.static voidwaitForNotValue(java.lang.String elementLocator, java.lang.String value)Waits for the given value in the given element to disappear/change.static voidwaitForNotVisible(java.lang.String elementLocator)Waits until the given element becomes invisible.static voidwaitForNotXpathCount(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.static voidwaitForNotXpathCount(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.static voidwaitForPageToLoad()Waits for the page to be loaded completely.static voidwaitForPopUp()Waits for any pop-up window to be loaded completely.static voidwaitForPopUp(java.lang.String windowID)Waits for some pop-up window to be loaded completely.static voidwaitForPopUp(java.lang.String windowID, long maxWaitingTime)Waits at most the given time for some pop-up window to be loaded completely.static voidwaitForPopUp(java.lang.String windowID, java.lang.String maxWaitingTime)Waits at most the given time for some pop-up window to be loaded completely.static voidwaitForSelectedId(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.static voidwaitForSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)Waits until the option of the given select at the given index is selected.static voidwaitForSelectedLabel(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.static voidwaitForSelectedValue(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.static voidwaitForStyle(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.static voidwaitForText(java.lang.String elementLocator, java.lang.String text)Waits for the given text embedded in the given element.static voidwaitForTextPresent(java.lang.String text)Waits for the given text to appear.static voidwaitForTitle(java.lang.String title)Waits for the given page title.static voidwaitForValue(java.lang.String elementLocator, java.lang.String value)Waits for the given value in the given element.static voidwaitForVisible(java.lang.String elementLocator)Waits until the given element becomes visible.static voidwaitForXpathCount(java.lang.String xpath, int count)Waits for the number of elements matching the given XPath expression is equal to the given count.static voidwaitForXpathCount(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.
-
-
-
Method Detail
-
addSelection
public static void addSelection(java.lang.String select, java.lang.String option)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
public static 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.- Parameters:
attributeLocator- the attribute locatortextPattern- the text pattern that the attribute value must match
-
assertAttribute
public static 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.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributetextPattern- the text pattern that the attribute value must match
-
assertChecked
public static void assertChecked(java.lang.String elementLocator)
Asserts that the given checkbox/radio button is checked.- Parameters:
elementLocator- the checkbox/radio button element locator
-
assertClass
public static void assertClass(java.lang.String elementLocator, java.lang.String clazzString)Asserts that the given element has the given class(es).- Parameters:
elementLocator- the element locatorclazzString- the class(es) string
-
assertElementCount
public static 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.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
assertElementCount
public static 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.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
assertElementPresent
public static void assertElementPresent(java.lang.String elementLocator)
Asserts that the given element is present.- Parameters:
elementLocator- locator identifying the element that should be present
-
assertEval
public static void assertEval(java.lang.String expression, java.lang.String textPattern)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
public static 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
public static void assertLoadTime(java.lang.String loadTime)
Asserts that the time needed to load a page does not exceed the given value.- Parameters:
loadTime- maximum load time in milliseconds
-
assertNotAttribute
public static 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.- Parameters:
attributeLocator- the attribute locatortextPattern- the text pattern that the attribute value must NOT match
-
assertNotAttribute
public static 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.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributetextPattern- the text pattern that the attribute value must NOT match
-
assertNotChecked
public static void assertNotChecked(java.lang.String elementLocator)
Asserts that the given checkbox/radio button is unchecked.- Parameters:
elementLocator- the checkbox/radio button element locator
-
assertNotClass
public static void assertNotClass(java.lang.String elementLocator, java.lang.String clazzString)Asserts that the given element doesn't have the given class(es).- Parameters:
elementLocator- the element locatorclazzString- the class(es) string
-
assertNotElementCount
public static 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.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
assertNotElementCount
public static 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.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
assertNotElementPresent
public static void assertNotElementPresent(java.lang.String elementLocator)
Asserts that the given element is not present.- Parameters:
elementLocator- locator identifying the element that should be NOT present
-
assertNotEval
public static void assertNotEval(java.lang.String expression, java.lang.String textPattern)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
public static 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.- Parameters:
selectLocator- the select element locatoridPattern- the ID pattern
-
assertNotSelectedIndex
public static 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.- Parameters:
selectLocator- the select element locatorindexPattern- the option index pattern
-
assertNotSelectedLabel
public static 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.- Parameters:
selectLocator- the select element locatorlabelPattern- the label pattern
-
assertNotSelectedValue
public static 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.- Parameters:
selectLocator- the select element locatorvaluePattern- the value pattern
-
assertNotStyle
public static 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.- Parameters:
elementLocator- the element locatorstyleText- the style that must NOT match (e.g.width: 10px; overflow: hidden;)
-
assertNotText
public static 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.- Parameters:
elementLocator- locator identifying the elementtext- the text that should not be embedded in the given element
-
assertNotTextPresent
public static void assertNotTextPresent(java.lang.String text)
Asserts that the given text is not present on the page.- Parameters:
text- the text that should NOT be present
-
assertNotTitle
public static void assertNotTitle(java.lang.String title)
Asserts that the page title does not match the given title.- Parameters:
title- the title that should not match
-
assertNotValue
public static void assertNotValue(java.lang.String elementLocator, java.lang.String valuePattern)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
public static void assertNotVisible(java.lang.String elementLocator)
Asserts that the given element is invisible.- Parameters:
elementLocator- the element locator.
-
assertNotXpathCount
public static 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.- 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 static 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.- 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 static 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
public static void assertPageSize(java.lang.String 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
-
assertSelectedId
public static 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.- Parameters:
selectLocator- the select element locatoridPattern- ID pattern
-
assertSelectedIndex
public static 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.- Parameters:
selectLocator- the select element locatorindexPattern- the option index pattern
-
assertSelectedLabel
public static 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.- Parameters:
selectLocator- the select element locatorlabelPattern- the label pattern
-
assertSelectedValue
public static 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.- Parameters:
selectLocator- the select element locatorvaluePattern- the value pattern
-
assertStyle
public static 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.- Parameters:
elementLocator- the element locatorstyleText- the style to match (e.g.width: 10px; overflow: hidden;)
-
assertText
public static void assertText(java.lang.String elementLocator, java.lang.String text)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
public static void assertTextPresent(java.lang.String text)
Asserts that the given text is present.- Parameters:
text- the text that should be present
-
assertTitle
public static void assertTitle(java.lang.String title)
Asserts that the given title matches the page title.- Parameters:
title- the title that should match the page title
-
assertValue
public static void assertValue(java.lang.String elementLocator, java.lang.String valuePattern)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
public static void assertVisible(java.lang.String elementLocator)
Asserts that the given element is visible.- Parameters:
elementLocator- the element locator
-
assertXpathCount
public static 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.- Parameters:
xpath- the XPath expressioncount- the number of elements that must match the given XPath expression
-
assertXpathCount
public static 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.- Parameters:
xpath- the XPath expressioncount- the number of elements that must match the given XPath expression
-
check
public static void check(java.lang.String elementLocator)
Checks/toggles the given element.- Parameters:
elementLocator- locator identifying the element to be checked/toggled
-
checkAndWait
public static void checkAndWait(java.lang.String elementLocator)
Checks/toggles the given element and waits for some activity to complete.- Parameters:
elementLocator- locator identifying the element to be checked/toggled
-
click
public static void click(java.lang.String elementLocator)
Clicks the given element.- Parameters:
elementLocator- locator identifying the element to be clicked.
-
clickAndWait
public static void clickAndWait(java.lang.String elementLocator)
Clicks the given element and waits for some activity to complete.- Parameters:
elementLocator- locator identifying the element to be clicked
-
close
public static void close()
Closes the browser.
-
contextMenu
public static void contextMenu(java.lang.String elementLocator)
Simulates a right-click on the given element.- Parameters:
elementLocator- locator identifying the element to fire events at
-
contextMenuAt
public static void contextMenuAt(java.lang.String elementLocator, java.lang.String coordinates)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
public static void contextMenuAt(java.lang.String elementLocator, int coordX, int coordY)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
public static 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.- Parameters:
cookie- name value pair of the new cookie
-
createCookie
public static void createCookie(java.lang.String cookie, java.lang.String options)Creates a new cookie.- Parameters:
cookie- name value pair of the new cookieoptions- cookie creation options (path, max_age and domain)
-
deleteAllVisibleCookies
public static void deleteAllVisibleCookies()
Removes all cookies visible to the current page.
-
deleteCookie
public static void deleteCookie(java.lang.String name)
Removes the cookie with the specified name.- Parameters:
name- the cookie's name
-
deleteCookie
public static void deleteCookie(java.lang.String name, java.lang.String options)Removes the cookie with the specified name.- Parameters:
name- the cookie's nameoptions- cookie removal options (path, domain and recurse)
-
doubleClick
public static void doubleClick(java.lang.String elementLocator)
Double-clicks the given element.- Parameters:
elementLocator- locator identifying the element to be double-clicked
-
doubleClickAndWait
public static void doubleClickAndWait(java.lang.String elementLocator)
Double-clicks the given element and waits for some activity to complete.- Parameters:
elementLocator- locator identifying the element to be double-clicked
-
echo
public static void echo(java.lang.String message)
Prints the given message to the log.- Parameters:
message- the message to print
-
mouseDown
public static void mouseDown(java.lang.String elementLocator)
Presses the left mouse button on an element, but does not release the button yet.- Parameters:
elementLocator- locator identifying the target element
-
mouseDownAt
public static 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.- Parameters:
elementLocator- locator identifying the target elementcoordinates- the coordinates relative to the given element
-
mouseDownAt
public static 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.- 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 static void mouseMove(java.lang.String elementLocator)
Moves the mouse to the given element.- Parameters:
elementLocator- locator identifying the target element
-
mouseMoveAt
public static void mouseMoveAt(java.lang.String elementLocator, java.lang.String coordinates)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
public static void mouseMoveAt(java.lang.String elementLocator, int coordX, int coordY)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
public static void mouseOut(java.lang.String elementLocator)
Moves the mouse out of the element's bounding box.- Parameters:
elementLocator- locator identifying the target element
-
mouseOver
public static void mouseOver(java.lang.String elementLocator)
Hovers the mouse over an element.- Parameters:
elementLocator- locator identifying the target element
-
mouseUp
public static void mouseUp(java.lang.String elementLocator)
Releases the left mouse button on an element.- Parameters:
elementLocator- locator identifying the target element
-
mouseUpAt
public static void mouseUpAt(java.lang.String elementLocator, java.lang.String coordinates)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
public static void mouseUpAt(java.lang.String elementLocator, int coordX, int coordY)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
public static void open(java.lang.String pageUrlString)
Opens the given URL.- Parameters:
pageUrlString- the URL to open
-
pause
public static void pause(long waitingTime)
Waits the given time.- Parameters:
waitingTime- the time in milliseconds to wait
-
pause
public static void pause(java.lang.String waitingTime)
Waits the given time.- Parameters:
waitingTime- the time in milliseconds to wait
-
removeSelection
public static void removeSelection(java.lang.String select, java.lang.String option)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
public static void select(java.lang.String select, java.lang.String option)Selects the given option of the given select.- Parameters:
select- the selectoption- the option to select
-
selectAndWait
public static 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.- Parameters:
select- the selectoption- the option to select
-
selectFrame
public static void selectFrame(java.lang.String frameTarget)
Selects the given frame.- Parameters:
frameTarget- the frame to be selected
-
selectWindow
public static void selectWindow()
Selects the top-level window.
-
selectWindow
public static void selectWindow(java.lang.String windowTarget)
Selects the given window.- Parameters:
windowTarget- the window to be selected
-
setTimeout
public static void setTimeout(long timeout)
Sets the timeout to the given value.- Parameters:
timeout- the new timeout in milliseconds
-
setTimeout
public static void setTimeout(java.lang.String timeout)
Sets the timeout to the given value.- Parameters:
timeout- the new timeout in milliseconds
-
startAction
public static void startAction(java.lang.String actionName)
Starts a new action using the given name.- Parameters:
actionName- the name of the action
-
store
public static void store(java.lang.String text, java.lang.String variableName)Stores the given text to the given variable.- Parameters:
text- the text to storevariableName- the variable name
-
storeAttribute
public static 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- Parameters:
attributeLocator- the attribute locatorvariableName- the variable name
-
storeAttribute
public static 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.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributevariableName- the variable name
-
storeElementCount
public static 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.- Parameters:
elementLocator- the element locatorvariableName- the variable name
-
storeEval
public static void storeEval(java.lang.String expression, java.lang.String variableName)Stores the result of evaluating the given expression to the given variable.- Parameters:
expression- the expression to evaluatevariableName- the variable name
-
storeText
public static 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.- Parameters:
elementLocator- the element locatorvariableName- the variable
-
storeTitle
public static void storeTitle(java.lang.String variableName)
Stores the title of the currently active document to the given variable.- Parameters:
variableName- the variable
-
storeValue
public static 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.- Parameters:
elementLocator- the element locatorvariableName- the variable
-
storeXpathCount
public static void storeXpathCount(java.lang.String xpath, java.lang.String variableName)Stores the number of elements matching the given XPath expression to the given variable.- Parameters:
xpath- the XPath expressionvariableName- the variable
-
submit
public static void submit(java.lang.String form)
Submits the given form.- Parameters:
form- the form to submit
-
submitAndWait
public static void submitAndWait(java.lang.String form)
Submits the given form and waits for some activity to complete.- Parameters:
form- the form to submit
-
type
public static void type(java.lang.String elementLocator, java.lang.String text)Types the given text into the given input field.- Parameters:
elementLocator- locator identifying the input fieldtext- the text to be typed
-
typeAndWait
public static 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.- Parameters:
elementLocator- locator identifying the input fieldtext- the text to be typed
-
uncheck
public static void uncheck(java.lang.String elementLocator)
Unchecks the given checkbox/radio button.- Parameters:
elementLocator- locator identifying the checkbox/radio button
-
uncheckAndWait
public static void uncheckAndWait(java.lang.String elementLocator)
Unchecks the given checkbox/radio button and waits for a page load.- Parameters:
elementLocator- locator identifying the checkbox/radio button
-
waitForAttribute
public static 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.- Parameters:
attributeLocator- the attribute locatortextPattern- the text pattern
-
waitForAttribute
public static void waitForAttribute(java.lang.String elementLocator, java.lang.String attributeName, java.lang.String textPattern)Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributetextPattern- the text pattern
-
waitForChecked
public static void waitForChecked(java.lang.String elementLocator)
Waits until the given checkbox/radio button becomes checked.- Parameters:
elementLocator- the checkbox/radio button element locator
-
waitForClass
public static void waitForClass(java.lang.String elementLocator, java.lang.String clazzString)Waits until the given element has the given class(es).- Parameters:
elementLocator- the element locatorclazzString- the class(es) string
-
waitForElementCount
public static 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.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
waitForElementCount
public static 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.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
waitForElementPresent
public static void waitForElementPresent(java.lang.String elementLocator)
Waits for the given element to appear.- Parameters:
elementLocator- locator identifying the element to wait for
-
waitForEval
public static void waitForEval(java.lang.String expression, java.lang.String textPattern)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
public static 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.- Parameters:
attributeLocator- the attribute locatortextPattern- the text pattern that must NOT match
-
waitForNotAttribute
public static 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.- Parameters:
elementLocator- the element locatorattributeName- the name of the attributetextPattern- the text pattern
-
waitForNotChecked
public static void waitForNotChecked(java.lang.String elementLocator)
Waits until the given checkbox/radio button becomes unchecked.- Parameters:
elementLocator- the checkbox/radio button element locator
-
waitForNotClass
public static void waitForNotClass(java.lang.String elementLocator, java.lang.String clazzString)Waits until the given element doesn't have the given class(es).- Parameters:
elementLocator- the element locatorclazzString- the class(es) string
-
waitForNotElementCount
public static 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.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
waitForNotElementCount
public static 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.- Parameters:
elementLocator- the element locatorcount- the number of elements
-
waitForNotElementPresent
public static void waitForNotElementPresent(java.lang.String elementLocator)
Waits for the given element to disappear.- Parameters:
elementLocator- locator identifying the element to disappear
-
waitForNotEval
public static 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.- Parameters:
expression- the expression to evaluatetextPattern- the text pattern that the evaluation result must NOT match
-
waitForNotSelectedId
public static 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.- Parameters:
selectLocator- the select element locatoridPattern- the ID pattern
-
waitForNotSelectedIndex
public static 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.- Parameters:
selectLocator- the select element locatorindexPattern- the option index pattern
-
waitForNotSelectedLabel
public static 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.- Parameters:
selectLocator- the select element locatorlabelPattern- the label pattern
-
waitForNotSelectedValue
public static 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.- Parameters:
selectLocator- the select element locatorvaluePattern- the value pattern
-
waitForNotStyle
public static 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.- Parameters:
elementLocator- the element locatorstyleText- the style that must NOT match (e.g.width: 10px; overflow: hidden;)
-
waitForNotText
public static void waitForNotText(java.lang.String elementLocator, java.lang.String text)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
public static void waitForNotTextPresent(java.lang.String text)
Waits for the given text to disappear/change.- Parameters:
text- the text that should disappear/change
-
waitForNotTitle
public static void waitForNotTitle(java.lang.String title)
Waits for the given page title change.- Parameters:
title- the page title that should change
-
waitForNotValue
public static void waitForNotValue(java.lang.String elementLocator, java.lang.String value)Waits for the given value in the given element to disappear/change.- Parameters:
elementLocator- locator identifying the element whose value should changevalue- the value that should change/disappear
-
waitForNotVisible
public static void waitForNotVisible(java.lang.String elementLocator)
Waits until the given element becomes invisible.- Parameters:
elementLocator- the element locator
-
waitForNotXpathCount
public static 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.- Parameters:
xpath- the XPath expressioncount- the number of elements currently matching the given XPath expression
-
waitForNotXpathCount
public static 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.- Parameters:
xpath- the XPath expressioncount- the number of elements currently matching the given XPath expression
-
waitForPageToLoad
public static void waitForPageToLoad()
Waits for the page to be loaded completely.
-
waitForPopUp
public static void waitForPopUp()
Waits for any pop-up window to be loaded completely.
-
waitForPopUp
public static void waitForPopUp(java.lang.String windowID)
Waits for some pop-up window to be loaded completely.- Parameters:
windowID- the ID of the window to wait for
-
waitForPopUp
public static void waitForPopUp(java.lang.String windowID, long maxWaitingTime)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
public static 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.- Parameters:
windowID- the ID of the window to wait formaxWaitingTime- the maximum waiting time
-
waitForSelectedId
public static 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.- Parameters:
selectLocator- the select element locatoridPattern- the ID pattern
-
waitForSelectedIndex
public static void waitForSelectedIndex(java.lang.String selectLocator, java.lang.String indexPattern)Waits until the option of the given select at the given index is selected.- Parameters:
selectLocator- the select element locatorindexPattern- the option index pattern
-
waitForSelectedLabel
public static 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.- Parameters:
selectLocator- the select element locatorlabelPattern- the label pattern
-
waitForSelectedValue
public static 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.- Parameters:
selectLocator- the select element locatorvaluePattern- the value pattern
-
waitForStyle
public static 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.- Parameters:
elementLocator- the element locatorstyleText- the style that must match (e.g.width: 10px; overflow: hidden;)
-
waitForText
public static void waitForText(java.lang.String elementLocator, java.lang.String text)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
public static void waitForTextPresent(java.lang.String text)
Waits for the given text to appear.- Parameters:
text- the text to wait for
-
waitForTitle
public static void waitForTitle(java.lang.String title)
Waits for the given page title.- Parameters:
title- the page title to wait for
-
waitForValue
public static void waitForValue(java.lang.String elementLocator, java.lang.String value)Waits for the given value in the given element.- Parameters:
elementLocator- locator identifying the element whose value should match the given valuevalue- the value to wait for
-
waitForVisible
public static void waitForVisible(java.lang.String elementLocator)
Waits until the given element becomes visible.- Parameters:
elementLocator- the element locator
-
waitForXpathCount
public static 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.- Parameters:
xpath- the XPath expressioncount- the number of elements to wait for
-
waitForXpathCount
public static 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.- Parameters:
xpath- the XPath expressioncount- the number of elements to wait for
-
evaluatesToTrue
public static boolean evaluatesToTrue(java.lang.String jsExpression)
Returns whether or not the given expression evaluates totrue.- Parameters:
jsExpression- the JavaScript expression to evaluate- Returns:
trueif and only if the given JavaScript expression is not blank and evaluates totrue
-
getWebDriver
public static final WebDriver getWebDriver()
Returns the webdriver instance.- Returns:
- webdriver instance
-
resolve
public static 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 static 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
nullif not found
-
stopAction
public static void stopAction()
Stops the current action.- See Also:
startAction(String)
-
findElement
public static 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 static 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
-
evaluate
public static 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
-
getAttribute
public static 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 static 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 static 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 static java.lang.String getPageText()
Returns the (visible) text of the current page.- Returns:
- the page's (visible) text
-
getText
public static 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 static java.lang.String getTitle()
Returns the title of the current page.- Returns:
- page title
-
getValue
public static 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 static 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 static 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:
trueif the attribute value matches the given pattern,falseotherwise
-
hasAttribute
public static 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:
trueif the attribute value matches the given pattern,falseotherwise
-
hasClass
public static 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:
trueif the element's class attribute contains all of the given class(es),falseotherwise
-
hasNotClass
public static 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- the element locatorclazz- the class string (multiple CSS classes separated by whitespace)- Returns:
trueif the element's class attribute does not contains any of the given class(es),falseotherwise
-
hasNotStyle
public static 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:
trueif NONE of the given CSS properties match the element's actual style,falseotherwise
-
hasStyle
public static 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:
trueif ALL of the given CSS properties match the elements actual style,falseotherwise
-
hasText
public static 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:
truethe text embedded by the given element contains the given text,falseotherwise
-
hasTitle
public static 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:
trueif the given title matches the page title,falseotherwise
-
hasValue
public static 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:
trueif the value of the given element matches the given value,falseotherwise
-
isChecked
public static 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:
trueif the element identified by the given element locator is checked,falseotherwise
-
isElementPresent
public static boolean isElementPresent(java.lang.String elementLocator)
Returns whether or not there is an element for the given locator.- Parameters:
elementLocator- the element locator- Returns:
trueif there at least one element has been found for the given locator,falseotherwise
-
isEnabled
public static boolean isEnabled(java.lang.String elementLocator)
Returns whether or not the given element is enabled.- Parameters:
elementLocator- the element locator- Returns:
trueif the element identified by the given element locator is enabled,falseotherwise
-
isEvalMatching
public static 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 expression to evaluatetextPattern- the text pattern- Returns:
trueif the evaluation result matches the given pattern,falseotherwise
-
isTextPresent
public static boolean isTextPresent(java.lang.String textPattern)
Checks that the given text is present.- Parameters:
textPattern- the text that should be present- Returns:
trueif the given text is present,falseotherwise
-
isVisible
public static boolean isVisible(java.lang.String elementLocator)
Returns whether or not the given element is visible.- Parameters:
elementLocator- the element locator- Returns:
trueif element was found and is visible,falseotherwise
-
-