Scroll text area with “Terms and Conditions” on Hy

2019-09-20 19:44发布

问题:

I have issue with scrolling "Terms and Conditions" text area to the bottom . The app is hybrid, I gave contex to know that the app is hybrid and its working driver.context("WEBVIEW_********"); , also the xpath to the text area is

/html/body/div[2]/ion-nav-view/div/div/div[2]/textarea

but I cant find a solution to scroll the text area to the last line with " All rights reserved " , so the button " I agree " to be available.

回答1:

You can swipe in an app with appium using the press method. First find the element to scroll on and then scroll down. E.g. :

TouchAction().press(el0).moveTo(el1).release()

It also works with coordinates if you wish to use that instead of webelements.

More information on touch actions can be found here : https://appium.io/docs/en/writing-running-appium/touch-actions/