I am trying to automate a scenario where there are some cards that are visible after horizontal scroll. Each card has an accessibility Id equal to cardholder name and at a time only one card is viewable. I am using below script to scroll to the specific card
Click.on(Target.the("card") .located(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(1))" + ".setAsHorizontalList()" + ".scrollIntoView(new UiSelector().description(\"abc\"))")))
but there is a problem. Whenever there is a scroll, an API call is made which takes sometime to load the card data. Above script works perfectly regarding scroll but doesn’t stop when the said card is reached. I suppose this problem is due to the reason that it takes sometime for data to load but the script can’t handle the wait. Hence, it assumes the card is not present. Is there any way we can add wait to AndroidUIAutomator script?