Unable to scroll a list view in android rather its clicking on dropdown

I’m unable to scroll a list view to find a particular text.
i tried with scrolltoexact too

Please share appium logs or error u r getting ?

for custom scrolls we can also use driver.swipe()

please find the script and logs
java script:
dr.scrollToExact(symbol);
dr.switchTo().activeElement().findElement(By.id(“com.msf.opx:id/txtPosSymbolDesc”));
List list1 = dr.findElements(By.id(“com.msf.opx:id/txtPosSymbolDesc”));
for (WebElement cr : list1) {
if (cr.getText().contains(symbol)) {
cr.click();
}
}

appium logs:

info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:7,“value”:“No element found”}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“id”,“selector”:“com.msf.opx:id/btnpositions”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.msf.opx:id/btnpositions”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding com.msf.opx:id/btnpositions using ID with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.msf.opx:id/btnpositions]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“4”}}
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“4”},“sessionId”:“9073d745-390b-49ce-a414-fc4d57cf78d1”}
info: ← POST /wd/hub/session/9073d745-390b-49ce-a414-fc4d57cf78d1/element 200 3555.858 ms - 87 {“status”:0,“value”:{“ELEMENT”:“4”},“sessionId”:“9073d745-390b-49ce-a414-fc4d57cf78d1”}
info: → POST /wd/hub/session/9073d745-390b-49ce-a414-fc4d57cf78d1/element/4/click {“id”:“4”}
info: [debug] Pushing command to appium work queue: [“element:click”,{“elementId”:“4”}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“4”}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: click
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:true}
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“9073d745-390b-49ce-a414-fc4d57cf78d1”}
info: ← POST /wd/hub/session/9073d745-390b-49ce-a414-fc4d57cf78d1/element/4/click 200 2132.285 ms - 76 {“status”:0,“value”:true,“sessionId”:“9073d745-390b-49ce-a414-fc4d57cf78d1”}
info: → POST /wd/hub/session/9073d745-390b-49ce-a414-fc4d57cf78d1/element {“using”:“-android uiautomator”,“value”:"new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().description("GE JAN16 > info: [debug] [BOOTSTRAP] [debug] Parsing scrollable: new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().text(“GE JAN16 20 CALL”).instance(0))
info: [debug] [BOOTSTRAP] [debug] UiSelector coerce type: boolean arg: true
info: [debug] [BOOTSTRAP] [debug] UiSelector coerce type: int arg: 0
info: [debug] [BOOTSTRAP] [debug] UiScrollable invoking method: public boolean com.android.uiautomator.core.UiScrollable.scrollIntoView(com.android.uiautomator.core.UiObject) throws com.android.uiautomator.core.UiObjectNotFoundException args: new UiSelector().text(“GE JAN16 20 CALL”).instance(0),
info: [debug] [BOOTSTRAP] [debug] UiScrollable coerce type: class com.android.uiautomator.core.UiObject arg: new UiSelector().text(“GE JAN16 20 CALL”).instance(0)
info: [debug] [BOOTSTRAP] [debug] UiSelector coerce type: class java.lang.String arg: “GE JAN16 20 CALL”
info: [debug] [BOOTSTRAP] [debug] UiSelector coerce type: int arg: 0
info: [debug] [BOOTSTRAP] [debug] Method name: scrollIntoView
info: [debug] [BOOTSTRAP] [debug] Setting uiObject for scrollIntoView
info: [debug] [BOOTSTRAP] [debug] Invoking method: public boolean com.android.uiautomator.core.UiScrollable.scrollIntoView(com.android.uiautomator.core.UiObject) throws com.android.uiautomator.core.UiObjectNotFoundException with: com.android.uiautomator.core.UiObject@1c1d2bca
info: [debug] [BOOTSTRAP] [debug] Invoke complete.
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[DESCRIPTION=GE JAN16 20 CALL, INSTANCE=0]
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[TEXT=GE JAN16 20 CALL, INSTANCE=0]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:7,“value”:“No element found”}
info: [debug] Condition unmet after 63589ms. Timing out.
info: [debug] Responding to client with error: {“status”:7,“value”:{“message”:“An element could not be located on the page using the given search parameters.”,“origValue”:“No element found”},“sessionId”:“9073d745-390b-49ce-a414-fc4d57cf78d1”}
info: ← POST /wd/hub/session/9073d745-390b-49ce-a414-fc4d57cf78d1/element 500 63523.488 ms - 195
info: → DELETE /wd/hub/session/9073d745-390b-49ce-a414-fc4d57cf78d1 {}…

I’m seeing this issue too, using Appium v1.4.3 with a Nexus 6 virtual device.

Hi Klambe,
Please try this code, its working for me
mention the scrollable instance respectively
dr.findElementByAndroidUIAutomator(“new UiScrollable(new UiSelector().scrollable(true).instance(1)).scrollIntoView” +
“(new UiSelector().textContains(”"+searchabletext+"").instance(0))");

Hi, I have tried the above code and the screen is moving up and down and it is not selecting the dropdown value. And then it quits the test. Can you provide me the example for selecting the dropdown value with exact code?

Hi Manikandan,
Still looking for solution?

Hey this is working but, I am handling date picker. But for year year selection scrollview is not working properly. Please can you guide me, how to handle it?
Thanks in advance.

@skbbabu12
Even i faced the same issues when trying to select a value from drop down.once when the drop down is clicked the appium is unable to find the next element and the script gets stopped there !! so i tried re-launching the app for that particular instance and it worked !

First try this solution manually by navigating to home page and re launching the app if it works.
Try adding a runInBackground/Start activity option after the drop down click ! it might work !
How?
Activate app-
driver.activateApp("com.android.calculator2”); -->Starting a new native application
driverUtil.activateApp("provide the app package name which you want to be reopened”);

Run in background:
AppiumDriver)driver.runAppInBackground(Duration.ofMillis(300));

Peace Out !
Thiru