How to tap and hold (Long press) using appium for Android?

后端 未结 6 1237
渐次进展
渐次进展 2021-02-06 14:06

Is there any code to tap and hold on Appium? i use python , is there any command to support it ?

For double click i used click on element twice, for tap and hold i am no

6条回答
  •  误落风尘
    2021-02-06 15:06

    In latest Java client versions below will work.

    AndroidTouchAction touch = new AndroidTouchAction (driver);
    touch.longPress(LongPressOptions.longPressOptions()
                    .withElement (ElementOption.element (element)))
                  .perform ();
    
    System.out.println("LongPressed Tapped");
    

提交回复
热议问题