如何使用python和appium滚动到视图中未显示的元素

问题描述 投票:0回答:1

我尝试使用以下功能通过显示屏中未出现的文本滚动到元素

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.*********"
}

我知道有一个触摸动作方法,但它仅适用于可见元素。

python python-3.x appium appium-android python-appium
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.