Appium日期选择器滚动android

问题描述:

伙计们,我是Appium Automation测试的新手,我需要根据下图自动执行android默认的OS日期选择器对话框.有人可以帮我吗?日期选择器对话框

Hey Guys I am new to Appium Automation testing... I need to work on automating the android default OS Date picker dialog as per the below image. Can some one help me on this?Date picker dialog

如前所述,您必须从左到右或从右到左自动执行滚动动作.

As you mentioned, you have to automate a scroll action from left-to-right or right-to-left.

这是一个如何从右向左滚动的示例:

This is an example of how to scroll from right-to-left:

    new TouchAction(wd)
            .press(900, 800)
            .waitAction(Duration.ofMillis(1000))
            .moveTo(900, 200)
            .release()
            .perform();

由于设备的分辨率很重要,因此您可以使用appium桌面获取正确的坐标.

You can use appium desktop in order to get the proper coordinates, since the resolution of your device matters.