这段代码不适用于 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/