Class FluentJavascriptActionsImpl<T>

  • Type Parameters:
    T - this object type to chain method calls
    All Implemented Interfaces:
    FluentJavascriptActions<T>

    public class FluentJavascriptActionsImpl<T>
    extends java.lang.Object
    implements FluentJavascriptActions<T>
    Javascript actions that can be used on a list or on a web element.

    Underlying webDriver must support javascript to support those actions.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T modifyAttribute​(java.lang.String attributeName, java.lang.String attributeValue)
      Modifies element attributes
      T scrollIntoView()
      Scrolls the current element into the visible area of the browser window.
      T scrollIntoView​(boolean alignWithTop)
      Scrolls the current element into the visible area of the browser window.
      T scrollToCenter()
      Scrolls center of the current element into the visible area of the browser window, respecting window size.
      • Methods inherited from class java.lang.Object

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

      • FluentJavascriptActionsImpl

        public FluentJavascriptActionsImpl​(T self,
                                           JavascriptControl javascript,
                                           java.util.function.Supplier<FluentWebElement> element)
        Creates a new fluent javascript actions.
        Parameters:
        self - object that will be returned by methods
        javascript - javascript control
        element - Supplier of element on which execute the action
    • Method Detail

      • scrollIntoView

        public T scrollIntoView​(boolean alignWithTop)
        Description copied from interface: FluentJavascriptActions
        Scrolls the current element into the visible area of the browser window.
        Specified by:
        scrollIntoView in interface FluentJavascriptActions<T>
        Parameters:
        alignWithTop - If true, the top of the element will be aligned to the top of the visible area of the scrollable ancestor. If false, the bottom of the element will be aligned to the bottom of the visible area of the scrollable ancestor.
        Returns:
        this object reference to chain methods calls
        See Also:
        element.scrollIntoView
      • scrollToCenter

        public T scrollToCenter()
        Description copied from interface: FluentJavascriptActions
        Scrolls center of the current element into the visible area of the browser window, respecting window size.
        Specified by:
        scrollToCenter in interface FluentJavascriptActions<T>
        Returns:
        this object reference to chain methods calls
      • modifyAttribute

        public T modifyAttribute​(java.lang.String attributeName,
                                 java.lang.String attributeValue)
        Description copied from interface: FluentJavascriptActions
        Modifies element attributes
        Specified by:
        modifyAttribute in interface FluentJavascriptActions<T>
        Parameters:
        attributeName - attribute to be change
        attributeValue - new attribute value
        Returns:
        this object reference to chain methods calls