Is there any way that I can scroll to an element and click in android using appium with ruby?
I have tried a variety of things:
scroll_to(text, scrollable index)
find_element(text: "India").click
scroll_to_exact("India")
find_element(text: "India").click
def scroll_to text
appium.driver.scroll_to text
text = %Q("#{text}")
args = appium.scroll_uiselector("new UiSelector().text(#{text})")
appium.driver.find_element :uiautomator, args
end
def scroll_to_exact(text, scrollable_index = 0)
end
Basically, I have a native app, consider whatsapp sign up, where you click on the country code tab and scroll and select a country. I would want to scroll and select "India" text in this.
I tried even using cordinates:
execute_script 'UIATarget.localTarget().flickFromTo({x:144, y:173},{x:677, y:73}).click'
All these would just scroll to the element, and again scroll back to the top of the page. Is there anyway, i can ask it to stop once identified and click on it