We are working on a Cordova mobile application. On a screen we have a list of values in a table format. We need to perform a scroll action if we want to select an element not in visible range on the mobile device. The methods scrollTo() and scrollToExact() have been tried but these do not scroll to the required element text, but beyond it, that is to end of values in list.
Moving to native context for performing scroll, had same result.
Also, tried Javascript methods window.scrollTo() and scrollintoView(), but scroll moves past required element.
Is there any other way to achieve scroll to necessary element on mobile screen, such that it does not scroll past the necessary element?
Above methods did not work for me, so I am using a workaround using below method,
window.scrollBy(0,200).
The operation I wanted was a click, after scrolling to necessary text. There is an attribute on the element that can be checked if click has happened, so I am making use of that in a loop to achieve.
Please check this solution also, if it works. Yet to try this solution.
@Vallabhaneni_Rakesh: scroll is something even I’m looking for a reliable solution for
earlier I could achieve it by swipe [mobile: swipe], but it no longer works since its been replaced with scrollTo etc methods under respective Driver, unfortunately they don’t work for me either.
There are multiple open issues on the same topic. Going through all those open issues might strike any work around for your case until a permanent solution comes.
check this- https://github.com/appium/appium/issues/3974
In my case,I am using driver.scrollTo(“text to be located”) to scroll and locate the particular text.As soon as I execute this command it’s scroll the whole UI for single time and then goes for locating it.
Also if we need to click the located element then simply use click event with it i.e. driver.scrollTo(“text to be located”).click();
I am testing Android app, scrolling works for list which is having less elements but it is fails to scroll long list say more than 200. When I use scroll function to scroll to element in long list, it scroll up to certain element then it fails saying element couldn’t be found.