如何使用python和appium滚动到视图中未显示的元素
我尝试通过以下功能按文本滚动到显示器中未显示的元素如何使用python和appium滚动到视图中未显示的元素,python,python-3.x,appium,appium-android,python-appium,Python,Python 3.x,Appium,Appium Android,Python Appium,我尝试通过以下功能按文本滚动到显示器中未显示的元素 self.driver.find_element_by_android_uiautomator("new UiScrollable(new UiSelector().scrollable(true)" + ".instance(0)).scrollIntoView(new UiSelector().text('מטבע חוץ').instance(0))") self.driver.find_element_by_android_uiaut
self.driver.find_element_by_android_uiautomator("new UiScrollable(new UiSelector().scrollable(true)" + ".instance(0)).scrollIntoView(new UiSelector().text('מטבע חוץ').instance(0))")
self.driver.find_element_by_android_uiautomator('new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"), "' + text + '")')
这些函数不会滚动元素
这是我想要的能力
desired_cap = {
"deviceName": deviceName,
"udid":uid,
"platformName": "Android",
"platformVersion": platformVersion,
"automationName":"UiAutomator2",
"appPackage": "com.******.********",
"appActivity": "com.*****.ui.*********"
}
我知道有一种触摸动作方法,但它只适用于可见元素
for each in range(1, 2):
driver.swipe(500, 1700, 500, 1000, 400)
如果需要滚动超过更改范围值的范围,则会滚动屏幕2次。例如,10次滚动将类似于范围(1,10)