小编Abh*_*gde的帖子

如何从APPIUM中的脚本滚动列表

嗨,我在Android中使用APPIUM.我需要做的是明智地滚动列表页面.我试着做以下.

    MobileElement element =(MobileElement)driver.findElement(By.className("android.widget.ListView"));
    JavascriptExecutor js = (JavascriptExecutor) driver;
    HashMap<String, String> scrollObject = new HashMap<>();
    scrollObject.put("direction", "down");
    scrollObject.put("element", ((RemoteWebElement) element).getId());
    js.executeScript("mobile: scrollTo", scrollObject);
Run Code Online (Sandbox Code Playgroud)

这可以工作,但列表会连续滚动,直到显示最后一个元素.我需要做的是明智地滚动列表页面.

android listview scroll appium appium-android

7
推荐指数
1
解决办法
1587
查看次数

标签 统计

android ×1

appium ×1

appium-android ×1

listview ×1

scroll ×1