简体   繁体   English

在带有 Appium 的混合应用程序上滚动带有“条款和条件”的文本区域

[英]Scroll text area with "Terms and Conditions" on Hybrid App with Appium

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_********");该应用程序是混合的,我给了上下文以知道该应用程序是混合的并且它的工作驱动程序driver.context("WEBVIEW_********"); , also the xpath to the text area is ,文本区域的xpath也是

/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.但我找不到将文本区域滚动到“保留所有权利”的最后一行的解决方案,因此“我同意”按钮可用。

You can swipe in an app with appium using the press method.您可以使用按下方法在带有 appium 的应用程序中滑动。 First find the element to scroll on and then scroll down.首先找到要滚动的元素,然后向下滚动。 Eg :例如:

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

It also works with coordinates if you wish to use that instead of webelements.如果您希望使用坐标而不是 webelement,它也适用于坐标。

More information on touch actions can be found here :https://appium.io/docs/en/writing-running-appium/touch-actions/可以在此处找到有关触摸操作的更多信息:https ://appium.io/docs/en/writing-running-appium/touch-actions/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM