Interface MiniWebDriver

    • Constructor Detail

    • Method Detail

      • url

         abstract String url()
        Returns:

        A string containing the URL of the document.

      • deleteCookies

         abstract Unit deleteCookies(String name, String url, String domain, String path)
        Parameters:
        name - Name of the cookies to remove.
        url - If specified, deletes all the cookies with the given name where domain and path match provided URL.
        domain - If specified, deletes only cookies with the exact domain.
        path - If specified, deletes only cookies with the exact path.
      • waitForSelector

         abstract Long waitForSelector(String selector, Long timeoutMillis)
        Parameters:
        timeoutMillis - The maximum time to wait for the element to become present.
        Returns:

        The remaining time until timeout when the element becomes present.

      • waitForNavigation

         abstract Long waitForNavigation(String oldUrl, Long timeoutMillis)
        Parameters:
        timeoutMillis - The maximum time to wait for the url to change.
      • exists

         abstract Boolean exists(String selector)
        Parameters:
        selector -
        • The selector of the element to check.

        Returns:

        Whether the element exists.

      • isHidden

         abstract Boolean isHidden(String selector)
        Parameters:
        selector -
        • The selector of the element to check.

        Returns:

        Whether the element is hidden.

      • isVisible

         abstract Boolean isVisible(String selector)
        Parameters:
        selector -
        • The selector of the element to check.

        Returns:

        Whether the element is visible.

      • visible

         abstract Boolean visible(String selector)
        Parameters:
        selector -
        • The selector of the element to check.

        Returns:

        Whether the element is visible.

      • isChecked

         abstract Boolean isChecked(String selector)
        Parameters:
        selector -
        • The selector of the element to check.

        Returns:

        Whether the element is checked.

      • focus

         abstract Unit focus(String selector)
        Parameters:
        selector -
        • A selector of an element to focus. If there are multiple elements satisfying the selector, the first will be focused.

      • type

         abstract Unit type(String selector, String text)
        Parameters:
        selector -
        • A selector of an element to focus. If there are multiple elements satisfying the selector, the first will be focused.

        text - The text to insert.
      • fill

         abstract Unit fill(String selector, String text)
        Parameters:
        selector -
        • A selector of an element to focus, and then fill text into it. If there are multiple elements satisfying the selector, the first will be focused.

        text - The text to fill.
      • press

         abstract Unit press(String selector, String key)
        Parameters:
        selector -
        • A selector of an element to focus, and then press a key. If there are multiple elements satisfying the selector, the first will be focused.

        key -
        • A key to press. The key can be a single character, a key name, or a combination of both.

      • click

         abstract Unit click(String selector, Integer count)
        Parameters:
        selector -
        • A selector of an element to focus. If there are multiple elements satisfying the selector, the first will be focused.

        count - The number of times to click.
      • clickTextMatches

         abstract Unit clickTextMatches(String selector, String pattern, Integer count)
        Parameters:
        selector -
        • A selector of an element to focus. If there are multiple elements satisfying the selector, the first will be focused.

        pattern - The pattern to match the text content.
        count - The number of times to click.
      • clickMatches

         abstract Unit clickMatches(String selector, String attrName, String pattern, Integer count)
        Parameters:
        selector -
        • A selector of an element to focus. If there are multiple elements satisfying the selector, the first will be focused.

        attrName - The attribute name to match.
        pattern - The pattern to match the text content.
        count - The number of times to click.
      • clickNthAnchor

         abstract String clickNthAnchor(Integer n, String rootSelector)
        Parameters:
        n - The index of the anchor element to click (0-based).
        rootSelector - The CSS selector of the root element to search within (default is "body").
        Returns:

        The href attribute of the clicked anchor element, or null if the element does not exist.

      • check

         abstract Unit check(String selector)
        Parameters:
        selector -
        • A selector of an element to check. If there are multiple elements satisfying the selector, the first will be checked.

      • uncheck

         abstract Unit uncheck(String selector)
        Parameters:
        selector -
        • A selector of an element to uncheck. If there are multiple elements satisfying the selector, the first will be focused.

      • scrollTo

         abstract Unit scrollTo(String selector)
        Parameters:
        selector -
        • A selector to search for element to scroll to. If there are multiple elements satisfying the selector, the first will be selected.

      • scrollToMiddle

         abstract Unit scrollToMiddle(Double ratio)
        Parameters:
        ratio - The ratio of the page to scroll to, 0.0 means the top, 1.0 means the bottom.
      • scrollToScreen

         abstract Unit scrollToScreen(Double screenNumber)
        Parameters:
        screenNumber - The screen number of the page to scroll to (0-based).
      • mouseWheelDown

         abstract Unit mouseWheelDown(Integer count, Double deltaX, Double deltaY, Long delayMillis)
        Parameters:
        count - The times to wheel down.
        deltaX - The distance to wheel horizontally.
        deltaY - The distance to wheel vertically.
        delayMillis - The delay time in milliseconds.
      • mouseWheelUp

         abstract Unit mouseWheelUp(Integer count, Double deltaX, Double deltaY, Long delayMillis)
        Parameters:
        count - The times to wheel up.
        deltaX - The distance to wheel horizontally.
        deltaY - The distance to wheel vertically.
        delayMillis - The delay time in milliseconds.
      • moveMouseTo

         abstract Unit moveMouseTo(Double x, Double y)
        Parameters:
        x - The x coordinate to move to.
        y - The y coordinate to move to.
      • moveMouseTo

         abstract Unit moveMouseTo(String selector, Integer deltaX, Integer deltaY)
        Parameters:
        deltaX - The distance to the left of the element.
        deltaY - The distance to the top of the element.
      • dragAndDrop

         abstract Unit dragAndDrop(String selector, Integer deltaX, Integer deltaY)
        Parameters:
        selector -
        • selector of the element to drag from.

        deltaX - The distance to drag horizontally.
        deltaY - The distance to drag vertically.
      • outerHTML

         abstract String outerHTML()
        Returns:

        The HTML markup of the document.

      • outerHTML

         abstract String outerHTML(String selector)
        Parameters:
        selector - The selector to locate the node.
        Returns:

        The HTML markup of the node.

      • selectFirstTextOrNull

         abstract String selectFirstTextOrNull(String selector)
        Parameters:
        selector - The selector to locate the node.
        Returns:

        The text content of the node.

      • selectTextAll

         abstract List<String> selectTextAll(String selector)
        Parameters:
        selector - The selector to locate the nodes.
        Returns:

        The text contents of the nodes.

      • selectFirstAttributeOrNull

         abstract String selectFirstAttributeOrNull(String selector, String attrName)
        Parameters:
        selector - The selector to locate the node.
        attrName - The attribute name to retrieve.
        Returns:

        The attribute value of the node.

      • selectAttributeAll

         abstract List<String> selectAttributeAll(String selector, String attrName, Integer start, Integer limit)
        Parameters:
        selector - The selector to locate the nodes.
        attrName - The attribute name to retrieve.
        start - The offset of the first node to select.
        limit - The maximum number of nodes to select.
        Returns:

        The attribute values of the nodes.

      • setAttribute

         abstract Unit setAttribute(String selector, String attrName, String attrValue)
        Parameters:
        selector - The CSS query to select an element.
        attrName - The attribute name to set.
        attrValue - The attribute value to set.
      • setAttributeAll

         abstract Unit setAttributeAll(String selector, String attrName, String attrValue)
        Parameters:
        selector - The CSS query to select elements.
        attrName - The attribute name to set.
        attrValue - The attribute value to set.
      • selectFirstPropertyValueOrNull

         abstract String selectFirstPropertyValueOrNull(String selector, String propName)
        Parameters:
        selector - The selector to locate the node.
        propName - The property name to retrieve.
        Returns:

        The property value of the node.

      • selectPropertyValueAll

         abstract List<String> selectPropertyValueAll(String selector, String propName, Integer start, Integer limit)
        Parameters:
        selector - The selector to locate the nodes.
        propName - The property name to retrieve.
        start - The offset of the first node to select.
        limit - The maximum number of nodes to select.
        Returns:

        The property values of the nodes.

      • setProperty

         abstract Unit setProperty(String selector, String propName, String propValue)
        Parameters:
        selector - The CSS query to select an element.
        propName - The property name to set.
        propValue - The property value to set.
      • setPropertyAll

         abstract Unit setPropertyAll(String selector, String propName, String propValue)
        Parameters:
        selector - The CSS query to select elements.
        propName - The property name to set.
        propValue - The property value to set.
      • selectHyperlinks

         abstract List<Hyperlink> selectHyperlinks(String selector, Integer offset, Integer limit)
        Parameters:
        selector - The CSS query to select elements.
        offset - The offset of the first element to select.
        limit - The maximum number of elements to select.
        Returns:

        The hyperlinks in the elements.

      • selectImages

         abstract List<String> selectImages(String selector, Integer offset, Integer limit)
        Parameters:
        selector - The CSS query to select elements.
        offset - The offset of the first element to select.
        limit - The maximum number of elements to select.
        Returns:

        The image URLs.

      • evaluate

         abstract Object evaluate(String expression)
        Parameters:
        expression - Javascript expression to evaluate
        Returns:

        Remote object value in case of primitive values or null.

      • evaluateValue

         abstract Object evaluateValue(String expression)
        Parameters:
        expression - Javascript expression to evaluate
        Returns:

        Remote object value in case of primitive values or JSON values (if it was requested).

      • captureScreenshot

         abstract String captureScreenshot(String selector)
        Parameters:
        selector - The selector of the element to capture.
        Returns:

        The screenshot of the element in base64 format.

      • delay

         abstract Unit delay(Long millis)
        Parameters:
        millis - The amount of time to delay, in milliseconds.