【已解决】appium 报错 unable to capture screen

在调试安卓设备的时候出现这样的报错:

Matched W3C error code 'unable to capture screen' to UnableToCaptureScreen

[WD Proxy] Matched '/wd/hub/session/fe541bfa-6b17-4aad-a327-b4a688261ec6/window/current/size' to command name 'getWindowSize'

[WD Proxy] Proxying [GET /wd/hub/session/fe541bfa-6b17-4aad-a327-b4a688261ec6/window/current/size] to [GEThttp://127.0.0.1:8200/wd/hub/session/269e635c-10ef-48c8-8989-c2b408faccc2/window/current/size] with body: {}

[MJSONWP (fe541bfa)] Encountered internal error running command: io.appium.uiautomator2.common.exceptions.TakeScreenshotException: Failed to capture a screenshot. Does the current view have 'secure' flag set?

可以先试试 

adb shell screencap -p /sdcard/screen.png

看当前页面是否可以截图保存在手机的scard页面。如果可以先排除app本身的问题,如果用这个命令都没有截图保存在手机,那么有可能当前app本身的问题。

还有一种就是安卓手机当前页面如果有系统键盘的存在,也是会出现这种报错。(点击屏幕,把系统键盘隐藏在定位就搞定了)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值