Skip to content

Confusion about scrolling #190

Description

@hujosh

I haven't been able to find what the final word on scrolling in Android is. According to the python source code, there is a method scroll. But it doesn't work.

According to the Android docs, there's a thing called UiScrollable. But it doesn't work.

According to the appium docs, there's a thing called TouchActions. But it doesn't work.

driver.execute_script("mobile: scroll", {"direction": 'down', 'element': el})
If you do this, you are told that "the method has not yet been implemented".

So what is the final word on scrolling? That it's completely broken? That scroll is supposed to work, and that there is something wrong with my setup?

Activity

  1. KazuCocoa commented on Nov 1, 2017

    @KazuCocoa
    Member

    I'm not sure your code and logs. But the followings may help your case, I think.
    (In my experience, I can scroll with the followings.)

    • for: UiScrollable (The behaviour depends on Android OS side)
    driver.find_element_by_android_uiautomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(someElement.instance(0));")
    
    • for TouchActions
      • We can also use '.swipe', though.
    • for mobile: scroll
      • XCUITest and required Appium 1.6.4+
  2. hujosh commented on Nov 1, 2017

    @hujosh
    Author

    Hi, I am talking about Android, not IOS.

    Yaeh, i tried the Uiscrollable thing. It doesn't work. Maybe i'll try it again today.

    I just think that scrolling shouldn't be this complicated. The Appium team should prioritise fixing it. How can something so fundamental to using a phone have so much confusion surrounding it? It doesn't make sense. Something isn't right.

  3. hujosh commented on Nov 1, 2017

    @hujosh
    Author

    Hey, do you think I am having problems because I am initializing my driver like this:
    cls.phone = webdriver.Remote(host, desired_caps)

    See, I am calling the Remote method. But apparently there's one specific to Android (https://github.com/appium/appium-android-driver) ? Should I be using that? The docs don't make this clear at all...

    Is the Appium team going to get someone to create a narrative documentation of everything? Because as of now, the extent of the documentation is fragments of contradictory info floating around the internet.

    Specifically:

    what the heck is uiautomaror? What the heck is uiautomator2? Why doesn't Appium 1.7.1 default to uiautomator2. Should I even use uiautomator2? What is Selenedroid? What is the difference between the Remote driver and the Android driver? I mean, what the heck is this https://github.com/appium/appium-android-driver?

  4. KazuCocoa commented on Nov 2, 2017

    @KazuCocoa
    Member

    According to the document, UiAutomator2 is preferred. And you also can see about drivers from this documentation .

  5. Akulavenkatesh commented on Feb 8, 2018

    @Akulavenkatesh
    Contributor

    You can try this to perform swipe down in Android:

    self.driver.swipe(470, 1400, 470, 950, 330)
    #self.driver.swipe(start_x, start_y, end_x, end_y, duration)
    

    you can use a try, except logic to check if an element is present or not after each swipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions