How to Scroll in Appium (Vertically, Horizontal, Scroll By Text) - Bug Reaper

                  Bug Reaper

Lean about Automation Testing,Selenium WebDriver,RestAssured,Appium,Jenkins,JAVA,API Automation,TestNG,Maven, Rest API, SOAP API,Linux,Maven,Security Testing,Interview Questions

Tuesday, 6 February 2018

How to Scroll in Appium (Vertically, Horizontal, Scroll By Text)

To Scroll Vertically in Appium

driver.swipe(100,500,100,100, 3000);// Here start x, start y, end x, end y, time //Revise swipe

                TouchAction action1=new TouchAction(driver);//Note it is TouchAction not TouchActions
action1.press(368, 868).waitAction(500).moveTo(368, 260).release().perform();

To Swipe Horizontal in Appium

TouchAction action1=new TouchAction(driver);
action1.press(0, 300).waitAction(500).moveTo(700, 300).release().perform();


Scroll By Text
driver.scrollTo("Brands We Love");// here text should be present in UI Automator for that Element
if that Element contains text use the same text to Scroll.

2 comments:

  1. showing an error that "The method press(int, int) is undefined for the type TouchActions"

    how to fix ??

    ReplyDelete
  2. driver.swipe() is deprecated

    ReplyDelete