Android变量longpress,求教:安卓自动化 long_press 长按变点击 问题

appium 版本:1.6.1

安卓版本:6.0

我的代码如下:

print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))

TouchAction(self.driver).long_press(element, None, None, 5000).perform()

print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))

执行没有报错,打印的时间也确实相差 5 秒,但是手机界面没有出现快捷操作(正常情况长按会出现快捷操作小图标),而是直接点进来,跳入新的界面。

appium 日志貌似也很正常,日志如下:

{}}],"sessionId":"c7351609-c95f-4e5c-b033-6fe7d7fafcda"}

[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{"action":"longPress","options":{"x":null,"y":null,"duration":5000}},{"action":"release","options":{}}],"c7351609-c95f-4e5c-b033-6fe7d7fafcda"]

[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:touchLongClick","params":{"x":0,"y":0,"duration":5000}}

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"element:touchLongClick","params":{"x":0,"y":0,"duration":5000}}

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: touchLongClick

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Display bounds: [0,0][720,1208]

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Performing TouchLongClick using element? false x: 360, y: 604, duration: 5000

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":true}

[AndroidBootstrap] Received command result from bootstrap

[MJSONWP] Responding to client with driver.performTouch() result: null

[HTTP]

[HTTP]

请问这个是什么原因呢

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值