Android Appium Scroll UiAutomator ExpandableListView 这种组合会如何运作?

标签 android scroll appium expandablelistview

这段代码不适用于 ExpandableListView。

driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector().resourceId(\"com.theentertainerme.entertainer:id/ex_listview_locations\")).scrollIntoView(new UiSelector().text(\"新加坡\")) "); Please see attched screenshot for element hirarchy

任何帮助!我做错了什么?

java-client 4.0, appium 1.5.3 同一段代码适用于 listView。

最佳答案

滚动试试下面的代码

Dimension size = driver.manage().window().getSize();
int x = size.width / 2;
int starty = (int) (size.height * 0.5);
int endy = (int) (size.height * 0.1);
driver.swipe(x, starty, x, endy);

如果您想在列表中选择一个项目,请查看以下链接 - how to click on element in gridview in appium using java

关于Android Appium Scroll UiAutomator ExpandableListView 这种组合会如何运作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43375503/

相关文章:

java - UI Automator 将屏幕截图作为纵向而不是横向

javascript - 在Cesium中禁用鼠标滚轮

android - 如何使用 Appium 单击/点击嵌入在文本消息中的链接?

java - 具有不同大小的 ActionBar 图标

android - 如何在 C 中将 *.vert 和 *.frag 转换为 char?

javascript - 为什么我的页面跳动这么多?

javascript - 如何在onscroll中正确使用addClass?

android - 在 appium 中启动应用程序时出现 getaddrinfo ENOTFOUND localhost 错误

android - 无法为混合 Android 应用程序运行 'forcedroid create'

android - 对非 SAF 内容的持久权限