Can any one help with horizontal scroll in appium android

Could you please help me with horizontal scrolling in android (left to right and right to left)

Can any one help me on this…

What have you tried so far? I’ve written a basic tutorial for element-relative-swipes and screen orientation that might be helpful:

If that doesn’t work for you, come back with some more detail on what you’re trying to do, what you’ve tried, and the relevant Appium/Android/Language details.

Thanks,
Hank

1 Like

Hi Hank,

Thank you for the reply… Will look into the tutorial.
Had tried scroll from top to bottom and bottom to top… its working… I am facing issue to scroll from left to right and right to left. I need to scroll completely to left to view the element. Anyways i will look into the tutorial and will reply back… :smile:

thank you,
Zetendra L

Hi Hank,

You are Awesome… It worked… Was trying to find the solution since 2 days… You made it easy… Big thank you… :smile:

I have another question…
Is there any way to find the toast messages… UIAautomator is not recognising…

than you,
Zetendra L

I’m not sure on that one, I haven’t done any work on interacting with toasts. Given that they’re temporary, and not intended to be user-interactable, I’d be very hesitant to try to automate testing for a Toast object.

Appium automation is not very speedy, and I would expect that any test that specifically targeted a Toast would be inconsistent unless the toast lasted for a significant amount of time.

That said, these resources might be helpful:
http://developer.android.com/guide/topics/ui/notifiers/toasts.html
http://developer.android.com/reference/android/widget/Toast.html

It looks like it would be an instance of android.widget.Toast, so perhaps you could use
driver.findElement(By.className("android.widget.Toast"))
I wouldn’t expect there to be more than one toast on screen at a time, but like I said earlier, I would be surprised to get consistent results unless your toast stays up for a long time.

Thanks,
Hank

I was able to get toast messages working via the following general steps:

  1. Perform action to trigger the toast message to appear on screen
  2. Take x number of screenshots
  3. Increase resolutions of all screenshots
  4. Use tessearct OCR to detect the toast message.
1 Like