Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用python和appium滚动到视图中未显示的元素_Python_Python 3.x_Appium_Appium Android_Python Appium - Fatal编程技术网

如何使用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)