【问题标题】:Scrolling till end of the listview in native android application using Appium in c#在 c# 中使用 Appium 在本机 android 应用程序中滚动到列表视图的末尾
【发布时间】:2015-06-16 12:09:27
【问题描述】:

我正在使用 appium dotnet 驱动程序来自动化原生 android 应用程序。我需要向下滚动到列表视图的末尾以填充下一个隐藏对象。我尝试过触摸动作,但它不起作用。请建议如何滚动到应用程序结束

【问题讨论】:

    标签: c# appium


    【解决方案1】:

    要使以下内容起作用,您需要知道列表视图中最后一项的文本:

    lvElement = driver.find_element(:class, 'android.widget.ListView')
    scrollToItem = {}
    scrollToItem["element"] = lvElement.ref
    scrollToItem["text"]='{the text of the last item}'
    

    现在使用“scrollTo”命令,该命令将滚动直到找到所需项目的文本:

    driver.execute_script("mobile: scrollTo", scrollToItem)
    

    【讨论】:

    • 谢谢 nissim ,如果这行得通,会告诉你的。
    • 这里的 scrollToitem 是什么。这是列表还是什么。我正在使用 c#
    • 嗨,我是在 c# 中使用 appium dot net 驱动程序和自动化原生 android 应用程序进行编码,所以请提出建议
    猜你喜欢
    • 2017-01-20
    • 2016-01-17
    • 1970-01-01
    • 2015-03-06
    • 1970-01-01
    • 2020-02-20
    • 2016-08-28
    • 2015-11-17
    • 1970-01-01
    相关资源
    最近更新 更多