Appium 紧急求助大神们,app 自动化报错,附上报错信息,魅族 pro6 和 Pro7 高配版会出现这个报错信息

aiyanyuan for Appium 中文文档小组 · 2017年09月04日 · 最后由 aiyanyuan 回复于 2017年09月04日 · 2531 次阅读

[{"brandName":"魅族","failMsg":"// CRASH: com.zlp.heyzhima (pid 3684)\n// Short Msg: android.view.WindowManager$BadTokenException\n// Long Msg: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?\n// Build Label: Meizu/meizu_PRO6/PRO6:6.0/MRA58K/1465802315:user/release-keys\n// Build Changelist: 1465802315\n// Build Time: 1465802768000\n// android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?\n// \tat android.view.ViewRootImpl.setView(ViewRootImpl.java:699)\n// \tat android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:319)\n// \tat android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)\n// \tat android.widget.PopupWindow.invokePopup(PopupWindow.java:1309)\n// \tat android.widget.PopupWindow.showAtLocation(PopupWindow.java:1078)\n// \tat android.widget.PopupWindow.showAtLocation(PopupWindow.java:1041)\n// \tat com.zlp.heyzhima.viewtool.PopWindow_Ok_Cancel_Tool.showAtBottom(PopWindow_Ok_Cancel_Tool.java:95)\n// \tat com.zlp.heyzhima.LoginActivity$1.run(LoginActivity.java:119)\n// \tat android.os.Handler.handleCallback(Handler.java:815)\n// \tat android.os.Handler.dispatchMessage(Handler.java:104)\n// \tat android.os.Looper.loop(Looper.java:207)\n// \tat android.app.ActivityThread.main(ActivityThread.java:5910)\n// \tat java.lang.reflect.Method.invoke(Native Method)\n// \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:918)\n// \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)\n// \n","modelName":"PRO 6","osVersion":"3.3.0"},{"brandName":"魅族","failMsg":"// CRASH: com.zlp.heyzhima (pid 12042)\n// Short Msg: android.view.WindowManager$BadTokenException\n// Long Msg: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?\n// Build Label: Meizu/meizu_PRO7H/PRO7H:7.0/NRD90M/1501691093:user/release-keys\n// Build Changelist: 1501691093\n// Build Time: 1501691092000\n// android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?\n// \tat android.view.ViewRootImpl.setView(ViewRootImpl.java:804)\n// \tat android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:351)\n// \tat android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)\n// \tat android.widget.PopupWindow.invokePopup(PopupWindow.java:1441)\n// \tat android.widget.PopupWindow.showAtLocation(PopupWindow.java:1212)\n// \tat android.widget.PopupWindow.showAtLocation(PopupWindow.java:1175)\n// \tat com.zlp.heyzhima.viewtool.PopWindow_Ok_Cancel_Tool.showAtBottom(PopWindow_Ok_Cancel_Tool.java:95)\n// \tat com.zlp.heyzhima.LoginActivity$1.run(LoginActivity.java:119)\n// \tat android.os.Handler.handleCallback(Handler.java:836)\n// \tat android.os.Handler.dispatchMessage(Handler.java:103)\n// \tat android.os.Looper.loop(Looper.java:203)\n// \tat android.app.ActivityThread.main(ActivityThread.java:6425)\n// \tat java.lang.reflect.Method.invoke(Native Method)\n// \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1113)\n// \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:974)\n// \n","modelName":"PRO7 高配版","osVersion":"3.3.0"}]

共收到 2 条回复 时间 点赞

你不是在自己的 Activity 上弹出 Window 呀,token 验证都不通过,当然你这个 window 的类型改成系统 Window 就可以了。

—— 来自 TesterHome 官方 安卓客户端

我自己在模拟器上把手机型号改成了魅族的没报错,别人试的有问题,这个是为什么啊?而且你说的 window 类型改成系统 window 是什么意思啊?

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册