I’m trying to automate twitter video feed, wherein I’ve to scroll down and play video for some time before moving to next.
I’ve tried using scrollintoview but that is not scrolling till complete video is visible.
driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().resourceId(\"com.twitter.android:id/video_player_view\"))");
Also, I tried using below:
MobileElement panel=driver.findElementByXPath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.view.ViewGroup");
Dimension dimension = panel.getSize();
int anchor = panel.getSize().getWidth()/2;
int heightStart = dimension.getHeight();
int scrollStart = heightStart;
Double heightEnd = dimension.getHeight() * (0.20);
int scrollEnd = heightEnd.intValue();
TouchAction action = new TouchAction(driver);
action.press(PointOption.point(anchor,scrollStart)).waitAction(WaitOptions.waitOptions(Duration.ofSeconds(1))).moveTo(PointOption.point(anchor,scrollEnd)).release().perform();
but again no luck! can someone please advise on how to automate this scenario.