Class StaticScriptCommands

java.lang.Object
com.xceptance.xlt.api.engine.scripting.StaticScriptCommands

public class StaticScriptCommands extends Object
Static 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 of AbstractWebDriverScriptTestCase or AbstractWebDriverModule.

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 AbstractWebDriverScriptTestCase as it prepares everything as needed.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addSelection(String select, String option)
    Adds the given option of the given select to the current selection.
    static void
    assertAttribute(String attributeLocator, String textPattern)
    Asserts that the value of the attribute identified by the given attribute locator matches the given text pattern.
    static void
    assertAttribute(String elementLocator, String attributeName, String textPattern)
    Asserts that the value of the attribute identified by the given element locator and attribute name matches the given text pattern.
    static void
    assertChecked(String elementLocator)
    Asserts that the given checkbox/radio button is checked.
    static void
    assertClass(String elementLocator, String clazzString)
    Asserts that the given element has the given class(es).
    static void
    assertElementCount(String elementLocator, int count)
    Asserts that the number of elements found by using the given element locator is equal to the given count.
    static void
    assertElementCount(String elementLocator, String count)
    Asserts that the number of elements found by using the given element locator is equal to the given count.
    static void
    assertElementPresent(String elementLocator)
    Asserts that the given element is present.
    static void
    assertEval(String expression, String textPattern)
    Asserts that evaluating the given expression matches the given text pattern.
    static void
    assertLoadTime(long loadTime)
    Asserts that the time needed to load a page does not exceed the given value.
    static void
    Asserts that the time needed to load a page does not exceed the given value.
    static void
    assertNotAttribute(String attributeLocator, String textPattern)
    Asserts that the value of the attribute identified by the given attribute locator does NOT match the given text pattern.
    static void
    assertNotAttribute(String elementLocator, String attributeName, String textPattern)
    Asserts that the value of the attribute identified by the given element locator and attribute name does NOT match the given text pattern.
    static void
    assertNotChecked(String elementLocator)
    Asserts that the given checkbox/radio button is unchecked.
    static void
    assertNotClass(String elementLocator, String clazzString)
    Asserts that the given element doesn't have the given class(es).
    static void
    assertNotElementCount(String elementLocator, int count)
    Asserts that the number of elements found by using the given element locator is unequal to the given count.
    static void
    assertNotElementCount(String elementLocator, String count)
    Asserts that the number of elements found by using the given element locator is unequal to the given count.
    static void
    Asserts that the given element is not present.
    static void
    assertNotEval(String expression, String textPattern)
    Asserts that evaluating the given expression does NOT match the given text pattern.
    static void
    assertNotSelectedId(String selectLocator, String idPattern)
    Asserts that no ID of all selected options of the given select element matches the given pattern.
    static void
    assertNotSelectedIndex(String selectLocator, String indexPattern)
    Asserts that the option of the given select element at the given index is not selected.
    static void
    assertNotSelectedLabel(String selectLocator, String labelPattern)
    Asserts that no label of all selected options of the given select element matches the given pattern.
    static void
    assertNotSelectedValue(String selectLocator, String valuePattern)
    Asserts that no value of all selected options of the given select element matches the given pattern.
    static void
    assertNotStyle(String elementLocator, String styleText)
    Asserts that the effective style of the element identified by the given element locator does NOT match the given style.
    static void
    assertNotText(String elementLocator, String text)
    Asserts that the embedded text of the given element does not contain the given text.
    static void
    Asserts that the given text is not present on the page.
    static void
    Asserts that the page title does not match the given title.
    static void
    assertNotValue(String elementLocator, String valuePattern)
    Asserts that the value of the given element doesn't match the given value.
    static void
    assertNotVisible(String elementLocator)
    Asserts that the given element is invisible.
    static void
    assertNotXpathCount(String xpath, int count)
    Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.
    static void
    Asserts that the number of elements locatable by the given XPath expression is not equal to the given count.
    static void
    assertPageSize(long pageSize)
    Asserts that the size of the actual page (including images etc.) does not exceed the given value.
    static void
    Asserts that the size of the actual page (including images etc.) does not exceed the given value.
    static void
    assertSelectedId(String selectLocator, String idPattern)
    Asserts that the ID of at least one selected option of the given select element matches the given pattern.
    static void
    assertSelectedIndex(String selectLocator, String indexPattern)
    Asserts that the option of the given select element at the given index is selected.
    static void
    assertSelectedLabel(String selectLocator, String labelPattern)
    Asserts that the label of at least one selected option of the given select element matches the given pattern.
    static void
    assertSelectedValue(String selectLocator, String valuePattern)
    Asserts that the value of at least one selected option of the given select element matches the given pattern.
    static void
    assertStyle(String elementLocator, String styleText)
    Asserts that the effective style of the element identified by the given element locator matches the given style.
    static void
    assertText(String elementLocator, String text)
    Asserts that the text embedded by the given element contains the given text.
    static void
    Asserts that the given text is present.
    static void
    Asserts that the given title matches the page title.
    static void
    assertValue(String elementLocator, String valuePattern)
    Asserts that the value of the given element matches the given value.
    static void
    assertVisible(String elementLocator)
    Asserts that the given element is visible.
    static void
    assertXpathCount(String xpath, int count)
    Asserts that the number of elements locatable by the given XPath expression is equal to the given count.
    static void
    Asserts that the number of elements locatable by the given XPath expression is equal to the given count.
    static void
    check(String elementLocator)
    Checks/toggles the given element.
    static void
    checkAndWait(String elementLocator)
    Checks/toggles the given element and waits for some activity to complete.
    static void
    click(String elementLocator)
    Clicks the given element.
    static void
    clickAndWait(String elementLocator)
    Clicks the given element and waits for some activity to complete.
    static void
    Closes the browser.
    static void
    contextMenu(String elementLocator)
    Simulates a right-click on the given element.
    static void
    contextMenuAt(String elementLocator, int coordX, int coordY)
    Simulates a right-click at the given coordinates (relative to the given element).
    static void
    contextMenuAt(String elementLocator, String coordinates)
    Simulates a right-click at the given coordinates (relative to the given element).
    static void
    Creates a new cookie.
    static void
    createCookie(String cookie, String options)
    Creates a new cookie.
    static void
    Removes all cookies visible to the current page.
    static void
    Removes the cookie with the specified name.
    static void
    deleteCookie(String name, String options)
    Removes the cookie with the specified name.
    static void
    doubleClick(String elementLocator)
    Double-clicks the given element.
    static void
    doubleClickAndWait(String elementLocator)
    Double-clicks the given element and waits for some activity to complete.
    static void
    echo(String message)
    Prints the given message to the log.
    static String
    evaluate(String jsExpression)
    Returns the result of evaluating the given JavaScript expression.
    static boolean
    evaluatesToTrue(String jsExpression)
    Returns whether or not the given expression evaluates to true.
    static WebElement
    findElement(String elementLocator)
    Returns the first element matching the given locator.
    findElements(String elementLocator)
    Returns all elements that match the given locator.
    static String
    getAttribute(String attributeLocator)
    Returns the value of the given element attribute locator.
    static String
    getAttribute(String elementLocator, String attributeName)
    Returns the value of the given element and attribute.
    static int
    getElementCount(String elementLocator)
    Returns the number of matching elements.
    static String
    Returns the (visible) text of the current page.
    static String
    getText(String elementLocator)
    Returns the (visible) text of the given element.
    static String
    Returns the title of the current page.
    static String
    getValue(String elementLocator)
    Returns the value of the given element.
    static final WebDriver
    Returns the webdriver instance.
    static int
    Returns the number of elements matching the given XPath expression.
    static boolean
    hasAttribute(String attributeLocator, String textPattern)
    Returns whether or not the value of the attribute identified by the given attribute locator matches the given text pattern.
    static boolean
    hasAttribute(String elementLocator, String attributeName, String textPattern)
    Returns whether or not the value of the given element and attribute matches the given text pattern.
    static boolean
    hasClass(String elementLocator, String clazz)
    Returns whether or not the given element has the given class(es).
    static boolean
    hasNotClass(String elementLocator, 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 boolean
    hasNotStyle(String elementLocator, 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 boolean
    hasStyle(String elementLocator, 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 boolean
    hasText(String elementLocator, String textPattern)
    Checks that the text embedded by the given element contains the given text.
    static boolean
    Checks that the given title matches the page title.
    static boolean
    hasValue(String elementLocator, String valuePattern)
    Checks that the value of the given element matches the given value.
    static boolean
    isChecked(String elementLocator)
    Returns whether or not the element identified by the given element locator is checked.
    static boolean
    isElementPresent(String elementLocator)
    Returns whether or not there is an element for the given locator.
    static boolean
    isEnabled(String elementLocator)
    Returns whether or not the given element is enabled.
    static boolean
    isEvalMatching(String expression, String textPattern)
    Returns whether or not the result of evaluating the given expression matches the given text pattern.
    static boolean
    isTextPresent(String textPattern)
    Checks that the given text is present.
    static boolean
    isVisible(String elementLocator)
    Returns whether or not the given element is visible.
    static void
    mouseDown(String elementLocator)
    Presses the left mouse button on an element, but does not release the button yet.
    static void
    mouseDownAt(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 void
    mouseDownAt(String elementLocator, String coordinates)
    Presses the left mouse button at the given coordinates (relative to the given element), but does not release the button yet.
    static void
    mouseMove(String elementLocator)
    Moves the mouse to the given element.
    static void
    mouseMoveAt(String elementLocator, int coordX, int coordY)
    Moves the mouse to the given coordinates (relative to the given element).
    static void
    mouseMoveAt(String elementLocator, String coordinates)
    Moves the mouse to the given coordinates (relative to the given element).
    static void
    mouseOut(String elementLocator)
    Moves the mouse out of the element's bounding box.
    static void
    mouseOver(String elementLocator)
    Hovers the mouse over an element.
    static void
    mouseUp(String elementLocator)
    Releases the left mouse button on an element.
    static void
    mouseUpAt(String elementLocator, int coordX, int coordY)
    Releases the left mouse button at the given coordinates (relative to the given element).
    static void
    mouseUpAt(String elementLocator, String coordinates)
    Releases the left mouse button at the given coordinates (relative to the given element).
    static void
    open(String pageUrlString)
    Opens the given URL.
    static void
    pause(long waitingTime)
    Waits the given time.
    static void
    pause(String waitingTime)
    Waits the given time.
    static void
    removeSelection(String select, String option)
    Removes the given option of the given select from the current selection.
    static String
    resolve(String resolvable)
    Resolves the given string.
    static String
    Resolves the given test data key
    static void
    select(String select, String option)
    Selects the given option of the given select.
    static void
    selectAndWait(String select, String option)
    Selects the given option of the given select and waits for some activity to complete.
    static void
    selectFrame(String frameTarget)
    Selects the given frame.
    static void
    Selects the top-level window.
    static void
    selectWindow(String windowTarget)
    Selects the given window.
    static void
    setTimeout(long timeout)
    Sets the timeout to the given value.
    static void
    setTimeout(String timeout)
    Sets the timeout to the given value.
    static void
    startAction(String actionName)
    Starts a new action using the given name.
    static void
    Stops the current action.
    static void
    store(String text, String variableName)
    Stores the given text to the given variable.
    static void
    storeAttribute(String attributeLocator, String variableName)
    Stores the value of the attribute identified by the given attribute locator to the given variable
    static void
    storeAttribute(String elementLocator, String attributeName, String variableName)
    Stores the value of the given element and attribute to the given variable.
    static void
    storeElementCount(String elementLocator, String variableName)
    Stores that the number of elements found by using the given element locator to the given variable.
    static void
    storeEval(String expression, String variableName)
    Stores the result of evaluating the given expression to the given variable.
    static void
    storeText(String elementLocator, String variableName)
    Stores the text of the element identified by the given locator to the given variable.
    static void
    storeTitle(String variableName)
    Stores the title of the currently active document to the given variable.
    static void
    storeValue(String elementLocator, String variableName)
    Stores the value (in case of a <textarea> the contained text) of the element identified by the given locator to the given variable.
    static void
    storeXpathCount(String xpath, String variableName)
    Stores the number of elements matching the given XPath expression to the given variable.
    static void
    submit(String form)
    Submits the given form.
    static void
    Submits the given form and waits for some activity to complete.
    static void
    type(String elementLocator, String text)
    Types the given text into the given input field.
    static void
    typeAndWait(String elementLocator, String text)
    Types the given text into the given input field and waits for some activity to complete.
    static void
    uncheck(String elementLocator)
    Unchecks the given checkbox/radio button.
    static void
    uncheckAndWait(String elementLocator)
    Unchecks the given checkbox/radio button and waits for a page load.
    static void
    waitForAttribute(String attributeLocator, String textPattern)
    Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.
    static void
    waitForAttribute(String elementLocator, String attributeName, String textPattern)
    Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.
    static void
    waitForChecked(String elementLocator)
    Waits until the given checkbox/radio button becomes checked.
    static void
    waitForClass(String elementLocator, String clazzString)
    Waits until the given element has the given class(es).
    static void
    waitForElementCount(String elementLocator, int count)
    Waits until the number of elements found by using the given element locator is equal to the given count.
    static void
    waitForElementCount(String elementLocator, String count)
    Waits until the number of elements found by using the given element locator is equal to the given count.
    static void
    waitForElementPresent(String elementLocator)
    Waits for the given element to appear.
    static void
    waitForEval(String expression, String textPattern)
    Waits until the result of evaluating the given expression matches the given text pattern.
    static void
    waitForNotAttribute(String attributeLocator, String textPattern)
    Waits until the value of the attribute identified by the given attribute locator does NOT match the given text pattern.
    static void
    waitForNotAttribute(String elementLocator, String attributeName, String textPattern)
    Waits until the value of the given element and attribute does NOT match the given text pattern.
    static void
    waitForNotChecked(String elementLocator)
    Waits until the given checkbox/radio button becomes unchecked.
    static void
    waitForNotClass(String elementLocator, String clazzString)
    Waits until the given element doesn't have the given class(es).
    static void
    waitForNotElementCount(String elementLocator, int count)
    Waits until the number of elements found by using the given element locator is unequal to the given count.
    static void
    waitForNotElementCount(String elementLocator, String count)
    Waits until the number of elements found by using the given element locator is unequal to the given count.
    static void
    Waits for the given element to disappear.
    static void
    waitForNotEval(String expression, String textPattern)
    Waits until the result of evaluating the given expression does NOT match the given text pattern.
    static void
    waitForNotSelectedId(String selectLocator, String idPattern)
    Waits until no ID of all selected options of the given select matches the given pattern.
    static void
    waitForNotSelectedIndex(String selectLocator, String indexPattern)
    Waits until the option of the given select element at the given index is not selected.
    static void
    waitForNotSelectedLabel(String selectLocator, String labelPattern)
    Waits until no label of all selected options of the given select matches the given pattern.
    static void
    waitForNotSelectedValue(String selectLocator, String valuePattern)
    Waits until no value of all selected options of the given select matches the given pattern.
    static void
    waitForNotStyle(String elementLocator, String styleText)
    Waits until the effective style of the element identified by the given element locator does NOT match the given style.
    static void
    waitForNotText(String elementLocator, String text)
    Waits for the given text embedded in the given element to disappear/change.
    static void
    Waits for the given text to disappear/change.
    static void
    Waits for the given page title change.
    static void
    waitForNotValue(String elementLocator, String value)
    Waits for the given value in the given element to disappear/change.
    static void
    waitForNotVisible(String elementLocator)
    Waits until the given element becomes invisible.
    static void
    waitForNotXpathCount(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 void
    Waits for the number of elements matching the given XPath expression change to a different value than the given one.
    static void
    Waits for the page to be loaded completely.
    static void
    Waits for any pop-up window to be loaded completely.
    static void
    waitForPopUp(String windowID)
    Waits for some pop-up window to be loaded completely.
    static void
    waitForPopUp(String windowID, long maxWaitingTime)
    Waits at most the given time for some pop-up window to be loaded completely.
    static void
    waitForPopUp(String windowID, String maxWaitingTime)
    Waits at most the given time for some pop-up window to be loaded completely.
    static void
    waitForSelectedId(String selectLocator, String idPattern)
    Waits until the ID of at least one selected option of the given select matches the given pattern.
    static void
    waitForSelectedIndex(String selectLocator, String indexPattern)
    Waits until the option of the given select at the given index is selected.
    static void
    waitForSelectedLabel(String selectLocator, String labelPattern)
    Waits until the label of at least one selected option of the given select matches the given pattern.
    static void
    waitForSelectedValue(String selectLocator, String valuePattern)
    Waits until the value of at least one selected option of the given select matches the given pattern.
    static void
    waitForStyle(String elementLocator, String styleText)
    Waits until the effective style of the element identified by the given element locator matches the given style.
    static void
    waitForText(String elementLocator, String text)
    Waits for the given text embedded in the given element.
    static void
    Waits for the given text to appear.
    static void
    Waits for the given page title.
    static void
    waitForValue(String elementLocator, String value)
    Waits for the given value in the given element.
    static void
    waitForVisible(String elementLocator)
    Waits until the given element becomes visible.
    static void
    waitForXpathCount(String xpath, int count)
    Waits for the number of elements matching the given XPath expression is equal to the given count.
    static void
    Waits for the number of elements matching the given XPath expression is equal to the given count.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StaticScriptCommands

      public StaticScriptCommands()
  • Method Details

    • addSelection

      public static void addSelection(String select, String option)
      Adds the given option of the given select to the current selection.
      Parameters:
      select - the select
      option - the option to be added to current selection
    • assertAttribute

      public static void assertAttribute(String attributeLocator, String textPattern)
      Asserts that the value of the attribute identified by the given attribute locator matches the given text pattern.
      Parameters:
      attributeLocator - the attribute locator
      textPattern - the text pattern that the attribute value must match
    • assertAttribute

      public static void assertAttribute(String elementLocator, String attributeName, String textPattern)
      Asserts that the value of the attribute identified by the given element locator and attribute name matches the given text pattern.
      Parameters:
      elementLocator - the element locator
      attributeName - the name of the attribute
      textPattern - the text pattern that the attribute value must match
    • assertChecked

      public static void assertChecked(String elementLocator)
      Asserts that the given checkbox/radio button is checked.
      Parameters:
      elementLocator - the checkbox/radio button element locator
    • assertClass

      public static void assertClass(String elementLocator, String clazzString)
      Asserts that the given element has the given class(es).
      Parameters:
      elementLocator - the element locator
      clazzString - the class(es) string
    • assertElementCount

      public static void assertElementCount(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 locator
      count - the number of elements
    • assertElementCount

      public static void assertElementCount(String elementLocator, 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 locator
      count - the number of elements
    • assertElementPresent

      public static void assertElementPresent(String elementLocator)
      Asserts that the given element is present.
      Parameters:
      elementLocator - locator identifying the element that should be present
    • assertEval

      public static void assertEval(String expression, String textPattern)
      Asserts that evaluating the given expression matches the given text pattern.
      Parameters:
      expression - the expression to evaluate
      textPattern - 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(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(String attributeLocator, 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 locator
      textPattern - the text pattern that the attribute value must NOT match
    • assertNotAttribute

      public static void assertNotAttribute(String elementLocator, String attributeName, String textPattern)
      Asserts that the value of the attribute identified by the given element locator and attribute name does NOT match the given text pattern.
      Parameters:
      elementLocator - the element locator
      attributeName - the name of the attribute
      textPattern - the text pattern that the attribute value must NOT match
    • assertNotChecked

      public static void assertNotChecked(String elementLocator)
      Asserts that the given checkbox/radio button is unchecked.
      Parameters:
      elementLocator - the checkbox/radio button element locator
    • assertNotClass

      public static void assertNotClass(String elementLocator, String clazzString)
      Asserts that the given element doesn't have the given class(es).
      Parameters:
      elementLocator - the element locator
      clazzString - the class(es) string
    • assertNotElementCount

      public static void assertNotElementCount(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 locator
      count - the number of elements
    • assertNotElementCount

      public static void assertNotElementCount(String elementLocator, 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 locator
      count - the number of elements
    • assertNotElementPresent

      public static void assertNotElementPresent(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(String expression, String textPattern)
      Asserts that evaluating the given expression does NOT match the given text pattern.
      Parameters:
      expression - the expression to evaluate
      textPattern - the text pattern that the evaluation result must NOT match
    • assertNotSelectedId

      public static void assertNotSelectedId(String selectLocator, String idPattern)
      Asserts that no ID of all selected options of the given select element matches the given pattern.
      Parameters:
      selectLocator - the select element locator
      idPattern - the ID pattern
    • assertNotSelectedIndex

      public static void assertNotSelectedIndex(String selectLocator, String indexPattern)
      Asserts that the option of the given select element at the given index is not selected.
      Parameters:
      selectLocator - the select element locator
      indexPattern - the option index pattern
    • assertNotSelectedLabel

      public static void assertNotSelectedLabel(String selectLocator, String labelPattern)
      Asserts that no label of all selected options of the given select element matches the given pattern.
      Parameters:
      selectLocator - the select element locator
      labelPattern - the label pattern
    • assertNotSelectedValue

      public static void assertNotSelectedValue(String selectLocator, String valuePattern)
      Asserts that no value of all selected options of the given select element matches the given pattern.
      Parameters:
      selectLocator - the select element locator
      valuePattern - the value pattern
    • assertNotStyle

      public static void assertNotStyle(String elementLocator, 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 locator
      styleText - the style that must NOT match (e.g. width: 10px; overflow: hidden;)
    • assertNotText

      public static void assertNotText(String elementLocator, String text)
      Asserts that the embedded text of the given element does not contain the given text.
      Parameters:
      elementLocator - locator identifying the element
      text - the text that should not be embedded in the given element
    • assertNotTextPresent

      public static void assertNotTextPresent(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(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(String elementLocator, 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 value
      valuePattern - the value that doesn't match the given element's value
    • assertNotVisible

      public static void assertNotVisible(String elementLocator)
      Asserts that the given element is invisible.
      Parameters:
      elementLocator - the element locator.
    • assertNotXpathCount

      public static void assertNotXpathCount(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 expression
      count - 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(String xpath, 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 expression
      count - 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(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(String selectLocator, 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 locator
      idPattern - ID pattern
    • assertSelectedIndex

      public static void assertSelectedIndex(String selectLocator, String indexPattern)
      Asserts that the option of the given select element at the given index is selected.
      Parameters:
      selectLocator - the select element locator
      indexPattern - the option index pattern
    • assertSelectedLabel

      public static void assertSelectedLabel(String selectLocator, 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 locator
      labelPattern - the label pattern
    • assertSelectedValue

      public static void assertSelectedValue(String selectLocator, 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 locator
      valuePattern - the value pattern
    • assertStyle

      public static void assertStyle(String elementLocator, String styleText)
      Asserts that the effective style of the element identified by the given element locator matches the given style.
      Parameters:
      elementLocator - the element locator
      styleText - the style to match (e.g. width: 10px; overflow: hidden;)
    • assertText

      public static void assertText(String elementLocator, 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 text
      text - the text that should be embedded in the given element
    • assertTextPresent

      public static void assertTextPresent(String text)
      Asserts that the given text is present.
      Parameters:
      text - the text that should be present
    • assertTitle

      public static void assertTitle(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(String elementLocator, 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 value
      valuePattern - the value that should match the given element's value
    • assertVisible

      public static void assertVisible(String elementLocator)
      Asserts that the given element is visible.
      Parameters:
      elementLocator - the element locator
    • assertXpathCount

      public static void assertXpathCount(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 expression
      count - the number of elements that must match the given XPath expression
    • assertXpathCount

      public static void assertXpathCount(String xpath, String count)
      Asserts that the number of elements locatable by the given XPath expression is equal to the given count.
      Parameters:
      xpath - the XPath expression
      count - the number of elements that must match the given XPath expression
    • check

      public static void check(String elementLocator)
      Checks/toggles the given element.
      Parameters:
      elementLocator - locator identifying the element to be checked/toggled
    • checkAndWait

      public static void checkAndWait(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(String elementLocator)
      Clicks the given element.
      Parameters:
      elementLocator - locator identifying the element to be clicked.
    • clickAndWait

      public static void clickAndWait(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(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(String elementLocator, String coordinates)
      Simulates a right-click at the given coordinates (relative to the given element).
      Parameters:
      elementLocator - locator identifying the target element
      coordinates - the coordinates relative to the given element
    • contextMenuAt

      public static void contextMenuAt(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 element
      coordX - the X coordinate relative to the given element
      coordY - the Y coordinate relative to the given element
    • createCookie

      public static void createCookie(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(String cookie, String options)
      Creates a new cookie.
      Parameters:
      cookie - name value pair of the new cookie
      options - 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(String name)
      Removes the cookie with the specified name.
      Parameters:
      name - the cookie's name
    • deleteCookie

      public static void deleteCookie(String name, String options)
      Removes the cookie with the specified name.
      Parameters:
      name - the cookie's name
      options - cookie removal options (path, domain and recurse)
    • doubleClick

      public static void doubleClick(String elementLocator)
      Double-clicks the given element.
      Parameters:
      elementLocator - locator identifying the element to be double-clicked
    • doubleClickAndWait

      public static void doubleClickAndWait(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(String message)
      Prints the given message to the log.
      Parameters:
      message - the message to print
    • mouseDown

      public static void mouseDown(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(String elementLocator, String coordinates)
      Presses the left mouse button at the given coordinates (relative to the given element), but does not release the button yet.
      Parameters:
      elementLocator - locator identifying the target element
      coordinates - the coordinates relative to the given element
    • mouseDownAt

      public static void mouseDownAt(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 element
      coordX - the X coordinate relative to the given element
      coordY - the Y coordinate relative to the given element
    • mouseMove

      public static void mouseMove(String elementLocator)
      Moves the mouse to the given element.
      Parameters:
      elementLocator - locator identifying the target element
    • mouseMoveAt

      public static void mouseMoveAt(String elementLocator, String coordinates)
      Moves the mouse to the given coordinates (relative to the given element).
      Parameters:
      elementLocator - locator identifying the target element
      coordinates - the coordinates relative to the given element
    • mouseMoveAt

      public static void mouseMoveAt(String elementLocator, int coordX, int coordY)
      Moves the mouse to the given coordinates (relative to the given element).
      Parameters:
      elementLocator - locator identifying the target element
      coordX - the X coordinate relative to the given element
      coordY - the Y coordinate relative to the given element
    • mouseOut

      public static void mouseOut(String elementLocator)
      Moves the mouse out of the element's bounding box.
      Parameters:
      elementLocator - locator identifying the target element
    • mouseOver

      public static void mouseOver(String elementLocator)
      Hovers the mouse over an element.
      Parameters:
      elementLocator - locator identifying the target element
    • mouseUp

      public static void mouseUp(String elementLocator)
      Releases the left mouse button on an element.
      Parameters:
      elementLocator - locator identifying the target element
    • mouseUpAt

      public static void mouseUpAt(String elementLocator, String coordinates)
      Releases the left mouse button at the given coordinates (relative to the given element).
      Parameters:
      elementLocator - locator identifying the target element
      coordinates - the coordinates relative to the given element
    • mouseUpAt

      public static void mouseUpAt(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 element
      coordX - the X coordinate relative to the given element
      coordY - the Y coordinate relative to the given element
    • open

      public static void open(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(String waitingTime)
      Waits the given time.
      Parameters:
      waitingTime - the time in milliseconds to wait
    • removeSelection

      public static void removeSelection(String select, String option)
      Removes the given option of the given select from the current selection.
      Parameters:
      select - the select
      option - the option to be removed from the current selection
    • select

      public static void select(String select, String option)
      Selects the given option of the given select.
      Parameters:
      select - the select
      option - the option to select
    • selectAndWait

      public static void selectAndWait(String select, String option)
      Selects the given option of the given select and waits for some activity to complete.
      Parameters:
      select - the select
      option - the option to select
    • selectFrame

      public static void selectFrame(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(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(String timeout)
      Sets the timeout to the given value.
      Parameters:
      timeout - the new timeout in milliseconds
    • startAction

      public static void startAction(String actionName)
      Starts a new action using the given name.
      Parameters:
      actionName - the name of the action
    • store

      public static void store(String text, String variableName)
      Stores the given text to the given variable.
      Parameters:
      text - the text to store
      variableName - the variable name
    • storeAttribute

      public static void storeAttribute(String attributeLocator, String variableName)
      Stores the value of the attribute identified by the given attribute locator to the given variable
      Parameters:
      attributeLocator - the attribute locator
      variableName - the variable name
    • storeAttribute

      public static void storeAttribute(String elementLocator, String attributeName, String variableName)
      Stores the value of the given element and attribute to the given variable.
      Parameters:
      elementLocator - the element locator
      attributeName - the name of the attribute
      variableName - the variable name
    • storeElementCount

      public static void storeElementCount(String elementLocator, String variableName)
      Stores that the number of elements found by using the given element locator to the given variable.
      Parameters:
      elementLocator - the element locator
      variableName - the variable name
    • storeEval

      public static void storeEval(String expression, String variableName)
      Stores the result of evaluating the given expression to the given variable.
      Parameters:
      expression - the expression to evaluate
      variableName - the variable name
    • storeText

      public static void storeText(String elementLocator, String variableName)
      Stores the text of the element identified by the given locator to the given variable.
      Parameters:
      elementLocator - the element locator
      variableName - the variable
    • storeTitle

      public static void storeTitle(String variableName)
      Stores the title of the currently active document to the given variable.
      Parameters:
      variableName - the variable
    • storeValue

      public static void storeValue(String elementLocator, String variableName)
      Stores the value (in case of a <textarea> the contained text) of the element identified by the given locator to the given variable.
      Parameters:
      elementLocator - the element locator
      variableName - the variable
    • storeXpathCount

      public static void storeXpathCount(String xpath, String variableName)
      Stores the number of elements matching the given XPath expression to the given variable.
      Parameters:
      xpath - the XPath expression
      variableName - the variable
    • submit

      public static void submit(String form)
      Submits the given form.
      Parameters:
      form - the form to submit
    • submitAndWait

      public static void submitAndWait(String form)
      Submits the given form and waits for some activity to complete.
      Parameters:
      form - the form to submit
    • type

      public static void type(String elementLocator, String text)
      Types the given text into the given input field.
      Parameters:
      elementLocator - locator identifying the input field
      text - the text to be typed
    • typeAndWait

      public static void typeAndWait(String elementLocator, String text)
      Types the given text into the given input field and waits for some activity to complete.
      Parameters:
      elementLocator - locator identifying the input field
      text - the text to be typed
    • uncheck

      public static void uncheck(String elementLocator)
      Unchecks the given checkbox/radio button.
      Parameters:
      elementLocator - locator identifying the checkbox/radio button
    • uncheckAndWait

      public static void uncheckAndWait(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(String attributeLocator, String textPattern)
      Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.
      Parameters:
      attributeLocator - the attribute locator
      textPattern - the text pattern
    • waitForAttribute

      public static void waitForAttribute(String elementLocator, String attributeName, String textPattern)
      Waits until the value of the attribute identified by the given attribute locator matches the given text pattern.
      Parameters:
      elementLocator - the element locator
      attributeName - the name of the attribute
      textPattern - the text pattern
    • waitForChecked

      public static void waitForChecked(String elementLocator)
      Waits until the given checkbox/radio button becomes checked.
      Parameters:
      elementLocator - the checkbox/radio button element locator
    • waitForClass

      public static void waitForClass(String elementLocator, String clazzString)
      Waits until the given element has the given class(es).
      Parameters:
      elementLocator - the element locator
      clazzString - the class(es) string
    • waitForElementCount

      public static void waitForElementCount(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 locator
      count - the number of elements
    • waitForElementCount

      public static void waitForElementCount(String elementLocator, 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 locator
      count - the number of elements
    • waitForElementPresent

      public static void waitForElementPresent(String elementLocator)
      Waits for the given element to appear.
      Parameters:
      elementLocator - locator identifying the element to wait for
    • waitForEval

      public static void waitForEval(String expression, String textPattern)
      Waits until the result of evaluating the given expression matches the given text pattern.
      Parameters:
      expression - the expression to evaluate
      textPattern - textPattern the text pattern the evaluation result must match
    • waitForNotAttribute

      public static void waitForNotAttribute(String attributeLocator, 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 locator
      textPattern - the text pattern that must NOT match
    • waitForNotAttribute

      public static void waitForNotAttribute(String elementLocator, String attributeName, String textPattern)
      Waits until the value of the given element and attribute does NOT match the given text pattern.
      Parameters:
      elementLocator - the element locator
      attributeName - the name of the attribute
      textPattern - the text pattern
    • waitForNotChecked

      public static void waitForNotChecked(String elementLocator)
      Waits until the given checkbox/radio button becomes unchecked.
      Parameters:
      elementLocator - the checkbox/radio button element locator
    • waitForNotClass

      public static void waitForNotClass(String elementLocator, String clazzString)
      Waits until the given element doesn't have the given class(es).
      Parameters:
      elementLocator - the element locator
      clazzString - the class(es) string
    • waitForNotElementCount

      public static void waitForNotElementCount(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 locator
      count - the number of elements
    • waitForNotElementCount

      public static void waitForNotElementCount(String elementLocator, 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 locator
      count - the number of elements
    • waitForNotElementPresent

      public static void waitForNotElementPresent(String elementLocator)
      Waits for the given element to disappear.
      Parameters:
      elementLocator - locator identifying the element to disappear
    • waitForNotEval

      public static void waitForNotEval(String expression, String textPattern)
      Waits until the result of evaluating the given expression does NOT match the given text pattern.
      Parameters:
      expression - the expression to evaluate
      textPattern - the text pattern that the evaluation result must NOT match
    • waitForNotSelectedId

      public static void waitForNotSelectedId(String selectLocator, String idPattern)
      Waits until no ID of all selected options of the given select matches the given pattern.
      Parameters:
      selectLocator - the select element locator
      idPattern - the ID pattern
    • waitForNotSelectedIndex

      public static void waitForNotSelectedIndex(String selectLocator, String indexPattern)
      Waits until the option of the given select element at the given index is not selected.
      Parameters:
      selectLocator - the select element locator
      indexPattern - the option index pattern
    • waitForNotSelectedLabel

      public static void waitForNotSelectedLabel(String selectLocator, String labelPattern)
      Waits until no label of all selected options of the given select matches the given pattern.
      Parameters:
      selectLocator - the select element locator
      labelPattern - the label pattern
    • waitForNotSelectedValue

      public static void waitForNotSelectedValue(String selectLocator, String valuePattern)
      Waits until no value of all selected options of the given select matches the given pattern.
      Parameters:
      selectLocator - the select element locator
      valuePattern - the value pattern
    • waitForNotStyle

      public static void waitForNotStyle(String elementLocator, 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 locator
      styleText - the style that must NOT match (e.g. width: 10px; overflow: hidden;)
    • waitForNotText

      public static void waitForNotText(String elementLocator, 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 change
      text - the text that should change/disappear
    • waitForNotTextPresent

      public static void waitForNotTextPresent(String text)
      Waits for the given text to disappear/change.
      Parameters:
      text - the text that should disappear/change
    • waitForNotTitle

      public static void waitForNotTitle(String title)
      Waits for the given page title change.
      Parameters:
      title - the page title that should change
    • waitForNotValue

      public static void waitForNotValue(String elementLocator, String value)
      Waits for the given value in the given element to disappear/change.
      Parameters:
      elementLocator - locator identifying the element whose value should change
      value - the value that should change/disappear
    • waitForNotVisible

      public static void waitForNotVisible(String elementLocator)
      Waits until the given element becomes invisible.
      Parameters:
      elementLocator - the element locator
    • waitForNotXpathCount

      public static void waitForNotXpathCount(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 expression
      count - the number of elements currently matching the given XPath expression
    • waitForNotXpathCount

      public static void waitForNotXpathCount(String xpath, 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 expression
      count - 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(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(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 for
      maxWaitingTime - the maximum waiting time
    • waitForPopUp

      public static void waitForPopUp(String windowID, 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 for
      maxWaitingTime - the maximum waiting time
    • waitForSelectedId

      public static void waitForSelectedId(String selectLocator, 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 locator
      idPattern - the ID pattern
    • waitForSelectedIndex

      public static void waitForSelectedIndex(String selectLocator, String indexPattern)
      Waits until the option of the given select at the given index is selected.
      Parameters:
      selectLocator - the select element locator
      indexPattern - the option index pattern
    • waitForSelectedLabel

      public static void waitForSelectedLabel(String selectLocator, 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 locator
      labelPattern - the label pattern
    • waitForSelectedValue

      public static void waitForSelectedValue(String selectLocator, 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 locator
      valuePattern - the value pattern
    • waitForStyle

      public static void waitForStyle(String elementLocator, String styleText)
      Waits until the effective style of the element identified by the given element locator matches the given style.
      Parameters:
      elementLocator - the element locator
      styleText - the style that must match (e.g. width: 10px; overflow: hidden;)
    • waitForText

      public static void waitForText(String elementLocator, String text)
      Waits for the given text embedded in the given element.
      Parameters:
      elementLocator - locator identifying the element whose text should contain the given text
      text - the text to wait for
    • waitForTextPresent

      public static void waitForTextPresent(String text)
      Waits for the given text to appear.
      Parameters:
      text - the text to wait for
    • waitForTitle

      public static void waitForTitle(String title)
      Waits for the given page title.
      Parameters:
      title - the page title to wait for
    • waitForValue

      public static void waitForValue(String elementLocator, String value)
      Waits for the given value in the given element.
      Parameters:
      elementLocator - locator identifying the element whose value should match the given value
      value - the value to wait for
    • waitForVisible

      public static void waitForVisible(String elementLocator)
      Waits until the given element becomes visible.
      Parameters:
      elementLocator - the element locator
    • waitForXpathCount

      public static void waitForXpathCount(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 expression
      count - the number of elements to wait for
    • waitForXpathCount

      public static void waitForXpathCount(String xpath, String count)
      Waits for the number of elements matching the given XPath expression is equal to the given count.
      Parameters:
      xpath - the XPath expression
      count - the number of elements to wait for
    • evaluatesToTrue

      public static boolean evaluatesToTrue(String jsExpression)
      Returns whether or not the given expression evaluates to true.
      Parameters:
      jsExpression - the JavaScript expression to evaluate
      Returns:
      true if and only if the given JavaScript expression is not blank and evaluates to true
    • getWebDriver

      public static final WebDriver getWebDriver()
      Returns the webdriver instance.
      Returns:
      webdriver instance
    • resolve

      public static String resolve(String resolvable)
      Resolves the given string.
      Parameters:
      resolvable - the resolvable string containing one or more test data placeholders
      Returns:
      resolved string
    • resolveKey

      public static String resolveKey(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
    • stopAction

      public static void stopAction()
      Stops the current action.
      See Also:
    • findElement

      public static WebElement findElement(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 List<WebElement> findElements(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 String evaluate(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 String getAttribute(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 String getAttribute(String elementLocator, String attributeName)
      Returns the value of the given element and attribute.
      Parameters:
      elementLocator - the element locator
      attributeName - the name of the attribute
      Returns:
      value of given element attribute locator
    • getElementCount

      public static int getElementCount(String elementLocator)
      Returns the number of matching elements.
      Parameters:
      elementLocator - the element locator
      Returns:
      number of elements matching the given locator
    • getPageText

      public static String getPageText()
      Returns the (visible) text of the current page.
      Returns:
      the page's (visible) text
    • getText

      public static String getText(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 String getTitle()
      Returns the title of the current page.
      Returns:
      page title
    • getValue

      public static String getValue(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(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(String attributeLocator, 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 locator
      textPattern - the text pattern
      Returns:
      true if the attribute value matches the given pattern, false otherwise
    • hasAttribute

      public static boolean hasAttribute(String elementLocator, String attributeName, String textPattern)
      Returns whether or not the value of the given element and attribute matches the given text pattern.
      Parameters:
      elementLocator - the element locator
      attributeName - the name of the attribute
      textPattern - the text pattern
      Returns:
      true if the attribute value matches the given pattern, false otherwise
    • hasClass

      public static boolean hasClass(String elementLocator, String clazz)
      Returns whether or not the given element has the given class(es).
      Parameters:
      elementLocator - the element locator
      clazz - 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
    • hasNotClass

      public static boolean hasNotClass(String elementLocator, 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 locator
      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 static boolean hasNotStyle(String elementLocator, 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 locator
      style - 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 static boolean hasStyle(String elementLocator, 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 locator
      style - 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 static boolean hasText(String elementLocator, 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 text
      textPattern - the text that should be embedded in the given element
      Returns:
      true the text embedded by the given element contains the given text, false otherwise
    • hasTitle

      public static boolean hasTitle(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 static boolean hasValue(String elementLocator, 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 value
      valuePattern - 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 static boolean isChecked(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 static boolean isElementPresent(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 static boolean isEnabled(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 static boolean isEvalMatching(String expression, String textPattern)
      Returns whether or not the result of evaluating the given expression matches the given text pattern.
      Parameters:
      expression - the expression to evaluate
      textPattern - the text pattern
      Returns:
      true if the evaluation result matches the given pattern, false otherwise
    • isTextPresent

      public static boolean isTextPresent(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 static boolean isVisible(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