Search code examples
androidscrollappiumexpandablelistview

Android Appium Scroll UiAutomator ExpandableListView How will this combination work?


This piece of code is not working for 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

Any help! what I am doing wrong?

java-client 4.0, appium 1.5.3 Same piece of code is working for listView.


Solution

  • for scroll try the below code

    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);
    

    If you want to select an Item in a list then look into the below link - how to click on element in gridview in appium using java