1

I'm not able to scroll with Karate appium. My native app only shows half of the grid, i need to scroll all the way to the right, and click the button. I have tried all the friendly locators, mouse operations, special keys. Not moving at all.

mouse().move(x, y).down().move(x, y).up() What else i can use? Thank you

1 Answers1

1

Friendly locator and Mouse API are supported only on the web so far, for native mobile. I would try script

   And driver.optional('@Views').click()
  And driver.script("mobile: scroll", { "strategy" : "accessibility id", "selector": "Seek Bar"})
  And driver.optional('@Seek Bar').click()
  And def seekbarId = driver.elementId("#io.appium.android.apis:id/seek")
  And driver.script("mobile: swipeGesture", { "elementId" : seekbarId, "direction": "left", "height": 50, "width" : 1080, "percent": 0.8 })
  And driver.delay(2000)
  And driver.script("mobile: swipeGesture", { "elementId" : seekbarId, "direction": "right", "height": 50, "width" : 1080, "percent": 0.8 })
  And driver.delay(2000)
  And driver.script("mobile: swipeGesture", { "elementId" : seekbarId, "direction": "left", "height": 50, "width" : 1080, "percent": 0.8 })

enter image description here

take a look at this android doc https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/android-mobile-gestures.md#mobile-swipegesture

Babu Sekaran
  • 4,129
  • 1
  • 9
  • 20