Class TouchActionsUtil


  • public class TouchActionsUtil
    extends Object
    Used to perform touch actions and gestures using touch operations.
    Author:
    Madhav Krishna
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void doubleTap​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.Point point, int pauseDurationInMs)  
      static void doubleTapOnElement​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement elem, int pauseDurationInMs)  
      static void nTaps​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.Point point, int n, int pauseDurationInMs)
      Used to tap N times.
      static void nTapsOnElement​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement elem, int n, int pauseDurationInMs)  
      static void scrollDown​(org.openqa.selenium.WebDriver webDriver, int percentScroll, int durationInMs)  
      static void scrollLeft​(org.openqa.selenium.WebDriver webDriver, int percentScroll, int durationInMs)  
      static void scrollRight​(org.openqa.selenium.WebDriver webDriver, int percentScroll, int durationInMs)  
      static void scrollUp​(org.openqa.selenium.WebDriver webDriver, int percentScroll, int durationInMs)  
      static void swipe​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.Point start, org.openqa.selenium.Point end, int swipeDurationInMs)  
      static void swipeDownFromElement​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement elem, int offset, int swipeDurationInMs)  
      static void swipeLeftFromElement​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement elem, int offset, int swipeDurationInMs)  
      static void swipeRightFromElement​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement elem, int offset, int swipeDurationInMs)  
      static void swipeUpFromElement​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement elem, int offset, int swipeDurationInMs)  
      static void tap​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.Point point, int holdDurationInMs)  
      static void tapOnElement​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement elem, int holdDurationInMs)  
      static void zoomIn​(org.openqa.selenium.WebDriver webDriver, int numPixels, int durationInMs)  
      static void zoomOut​(org.openqa.selenium.WebDriver webDriver, int numPixels, int durationInMs)  
    • Constructor Detail

      • TouchActionsUtil

        public TouchActionsUtil()
    • Method Detail

      • tap

        public static void tap​(org.openqa.selenium.WebDriver webDriver,
                               org.openqa.selenium.Point point,
                               int holdDurationInMs)
      • tapOnElement

        public static void tapOnElement​(org.openqa.selenium.WebDriver webDriver,
                                        org.openqa.selenium.WebElement elem,
                                        int holdDurationInMs)
      • doubleTap

        public static void doubleTap​(org.openqa.selenium.WebDriver webDriver,
                                     org.openqa.selenium.Point point,
                                     int pauseDurationInMs)
      • doubleTapOnElement

        public static void doubleTapOnElement​(org.openqa.selenium.WebDriver webDriver,
                                              org.openqa.selenium.WebElement elem,
                                              int pauseDurationInMs)
      • nTaps

        public static void nTaps​(org.openqa.selenium.WebDriver webDriver,
                                 org.openqa.selenium.Point point,
                                 int n,
                                 int pauseDurationInMs)
        Used to tap N times.
        Parameters:
        webDriver -
        point -
        n -
        pauseDurationInMs -
      • nTapsOnElement

        public static void nTapsOnElement​(org.openqa.selenium.WebDriver webDriver,
                                          org.openqa.selenium.WebElement elem,
                                          int n,
                                          int pauseDurationInMs)
      • swipe

        public static void swipe​(org.openqa.selenium.WebDriver webDriver,
                                 org.openqa.selenium.Point start,
                                 org.openqa.selenium.Point end,
                                 int swipeDurationInMs)
      • swipeUpFromElement

        public static void swipeUpFromElement​(org.openqa.selenium.WebDriver webDriver,
                                              org.openqa.selenium.WebElement elem,
                                              int offset,
                                              int swipeDurationInMs)
      • swipeDownFromElement

        public static void swipeDownFromElement​(org.openqa.selenium.WebDriver webDriver,
                                                org.openqa.selenium.WebElement elem,
                                                int offset,
                                                int swipeDurationInMs)
      • swipeRightFromElement

        public static void swipeRightFromElement​(org.openqa.selenium.WebDriver webDriver,
                                                 org.openqa.selenium.WebElement elem,
                                                 int offset,
                                                 int swipeDurationInMs)
      • swipeLeftFromElement

        public static void swipeLeftFromElement​(org.openqa.selenium.WebDriver webDriver,
                                                org.openqa.selenium.WebElement elem,
                                                int offset,
                                                int swipeDurationInMs)
      • zoomIn

        public static void zoomIn​(org.openqa.selenium.WebDriver webDriver,
                                  int numPixels,
                                  int durationInMs)
      • zoomOut

        public static void zoomOut​(org.openqa.selenium.WebDriver webDriver,
                                   int numPixels,
                                   int durationInMs)
      • scrollUp

        public static void scrollUp​(org.openqa.selenium.WebDriver webDriver,
                                    int percentScroll,
                                    int durationInMs)
      • scrollDown

        public static void scrollDown​(org.openqa.selenium.WebDriver webDriver,
                                      int percentScroll,
                                      int durationInMs)
      • scrollRight

        public static void scrollRight​(org.openqa.selenium.WebDriver webDriver,
                                       int percentScroll,
                                       int durationInMs)
      • scrollLeft

        public static void scrollLeft​(org.openqa.selenium.WebDriver webDriver,
                                      int percentScroll,
                                      int durationInMs)