【问题标题】:Android Appium Scroll UiAutomator ExpandableListView How will this combination work?Android Appium Scroll UiAutomator ExpandableListView 这个组合将如何工作?
【发布时间】:2017-09-08 14:04:33
【问题描述】:

这段代码不适用于 ExpandableListView。

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

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

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

【问题讨论】:

    标签: android scroll appium expandablelistview


    【解决方案1】:

    滚动试试下面的代码

    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

    【讨论】:

    • 我的答案左侧你可以得到浅灰色的刻度线。当您单击时,它变为绿色
    • 完成,谢谢 :) 但现在还有另一个问题,从 appium 1.6.4 开始,它说“刷卡”已被弃用。处理滑动/滚动的新方法是什么?
    • 我没有升级appium版本。如果我知道,我会告诉你
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-20
    • 1970-01-01
    • 1970-01-01
    • 2016-11-20
    • 2015-05-03
    相关资源
    最近更新 更多