收藏
回答

Appium无法获取微信小程序页面元素,但是获取微信页面元素没有问题。

自从今年7月份以来,微信升级后, appium就无法获取小程序页面元素了。

appium的error log:

[MJSONWP (5ddd1a8c)]     at JWProxy.proxy (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:213:13)
[W3C] Matched W3C error code 'unknown error' to UnknownError
[HTTP] <-- GET /wd/hub/session/5ddd1a8c-b45d-4505-906e-4932fe5020e6/source 500 15567 ms - 244
[HTTP] 
[WD Proxy] Got response with status 200: {"sessionId":"dd1cd7a1-4ed4-4c63-86c4-dbd6b2f9e60b","value":"iVBORw0KGgoAAAANSUhEUgAABDgAAAkkCAYAAAD508+vAAAAAXNSR0IArs4c6QAAAARzQklUCAgI\nCHwIZIgAACAASURBVHic7N15fFT1vT\/+1+ec2SfrJEAgAwElILviAi4gaG0Fd0VbW7XLbdV6r1p\/\nt7X2am8X22rbb29duone20W7uuECqCjBBQ2KIkEQCQKBSSCEJCSZfeacz++PWTKTTJKZyWQZeD0f\nD83kzJlzPmSZzHnN+\/P+CLc3IEFERERERERElMeUkR4AEREREREREdFgMeAgIiIiIiIiorzHgIOI\niIiIiIiI8h4DDiIiIiIiIiLKeww4iIiIiIiIiCjvMeAgIiIiIiIiorzHgIOIiIiIiIiI8h4DDiIi\nIiIiIiLKeww4iIiIiIiIiCjvMeAgIiIiIiIiorzHgIOIiIiIiIiI8h4DDiIiIiIiIiLKeww4iIiI\niIiIiCjvMeAgIiIiIiIiorzHgIOIiIiIiIiI8h4DDiIiIiIiIiLKeww4iIiIiIiIiCjvMeAgIiIi\nIiIiorzHgIOIiIiIiIiI8h4DDiIiIiIiIiLKe4aRHsBosbu+Pu19LVYrnE7nEI7mWCIhtC4YGv8C\ndefPoAo\/ZEAHdAmhAFrIBG3OXQhVfQ0wlgAQIz1g6sPVn7kMR5qbIQAIiPh3SiT8hx7bkeI2AMgU\nt2X0\/zJ6O3G7jG4vHzcOT7763OD\/MURERERp8Hq9aGpsRP3u9K8VYqqnVmNCZSVsNtsQjIyIUjnu\nA441a1bjpTVrMn7cl667DgsWnjkEIxqYy+VCe3sbXC4XAMDn9cLlcqGsrAyOsjIAgMPhQJmjDFOr\nq0dkjICEqf4\/oLqehAxFAg3oEpouI1esOoCwBPQA1A9+CGXzD6AA0E64EsEz\/oyRDjqCwSDWrXsF\nUkp89rOfg8lkGtHx...
[WD Proxy] Matched '/wd/hub/session/5ddd1a8c-b45d-4505-906e-4932fe5020e6/window/current/size' to command name 'getWindowSize'
[WD Proxy] Proxying [GET /wd/hub/session/5ddd1a8c-b45d-4505-906e-4932fe5020e6/window/current/size] to [GET http://localhost:8200/wd/hub/session/dd1cd7a1-4ed4-4c63-86c4-dbd6b2f9e60b/window/current/size] with body: {}
[MJSONWP (5ddd1a8c)] Responding to client with driver.getScreenshot() result: "iVBORw0KGgoAAAANSUhEUgAABDgAAAkkCAYAAAD508+vAAAAAXNSR0IArs4c6QAAAARzQklUCAgI\nCHwIZIgAACAASURBVHic7N15fFT1vT/+1+ec2SfrJEAgAwElILviAi4gaG0Fd0VbW7XLbdV6r1p/\nt7X2am8X22rbb29duone20W7uuECqCjBBQ2KIkEQCQKBSSCEJCSZfeacz++PWTKTTJKZyWQZeD0f\nD83kzJlzPmSZzHnN+/P+CLc3IEFERERERERElMeUkR4AEREREREREdFgMeAgIiIiIiIiorzHgIOI\niIiIiIiI8h4DDiIiIiIiIiLKeww4iIiIiIiIiCjvMeAgIiIiIiIiorzHgIOIiIiIiIiI8h4DDiIi\nIiIiIiLKeww4iIiIiIiIiCjvMeAgIiIiIiIiorzHgIOIiIiIiIiI8h4DDiIiIiIiIiLKeww4iIiI\niIiIiCjvMeAgIiIiIiIiorzHgIOIiIiIiIiI8h4DDiIiIiIiIiLKeww4iIiIiIiIiCjvMeAgIiIi\nIiIiorzHgIOIiIiIiIiI8h4DDiIiIiIiIiLKe4aRHsBosbu+Pu19LVYrnE7nEI7mWCIhtC4YGv8C\ndefPoAo/ZEAHdAmhAFrIBG3OXQhVfQ0wlgAQIz1g6sPVn7kMR5qbIQAIiPh3SiT8hx7bkeI2AMgU\nt2X0/zJ6O3G7jG4vHzcOT7763OD/MURERERp8Hq9aGpsRP3u9K8VYqqnVmNCZSVsNtsQjIyIUjnu\nA441a1bjpTVrMn7cl667DgsWnjkEIxqYy+VCe3sbXC4XAMDn9cLlcqGsrAyOsjIAgMPhQJmjDFOr\nq0dkjICEqf4/oLqehAxFAg3oEpouI1esOoCwBPQA1A9+CGXzD6AA0E64EsEz/oyRDjqCwSDWrXsF\nUkp89rOfg8lkGtHxjAYCwJFDh+PhRneogaRtSPGxL8khRuJt2WubDokx48YN8l9BRERElJ4NNTVY\nu3Y1fF...
[HTTP] <-- GET /wd/hub/session/5ddd1a8c-b45d-4505-906e-4932fe5020e6/screenshot 200 16205 ms - 828480
[HTTP] 
[WD Proxy] Got response with status 200: {"sessionId":"dd1cd7a1-4ed4-4c63-86c4-dbd6b2f9e60b","value":{"height":2139,"width":1080}}
[WD Proxy] Replacing sessionId dd1cd7a1-4ed4-4c63-86c4-dbd6b2f9e60b with 5ddd1a8c-b45d-4505-906e-4932fe5020e6
[HTTP] <-- GET /wd/hub/session/5ddd1a8c-b45d-4505-906e-4932fe5020e6/window/current/size 200 16327 ms - 100



获取页面元素超时:GET /wd/hub/session/5ddd1a8c-b45d-4505-906e-4932fe5020e6/source 500

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Timed out after 10000 milliseconds waiting for root AccessibilityNodeInfo

如果把微信降级到老版本的话这个问题就不发生了。 但是微信会自动升级,所以测试开发的时候总是要先降级才能用。 很恼人的一个问题。

希望微信端能把这个问题解了。

回答关注问题邀请回答
收藏

8 个回答

  • 社区技术运营专员-CJiang
    社区技术运营专员-CJiang
    2020-09-27

    你好,麻烦到Appium对应的平台下进行反馈。

    2020-09-27
    有用
    回复 6
    查看更多(1)
  • 🐯玛奇朵呀²º²²
    🐯玛奇朵呀²º²²
    2021-10-13

    我也遇到了,重新开了一个帖子,希望能引起关注

    2021-10-13
    有用 1
    回复
  • %逗你玩
    %逗你玩
    2021-07-23

    首次启动的微信窗口必然会遇到,但第二次执行就正常了,目前只能加入失败重试逻辑规避

     io.appium.uiautomator2.common.exceptions.UiAutomator2Exception: Timed out after 15519ms waiting for the root AccessibilityNodeInfo in the active window. Make sure the active window is not constantly hogging the main UI thread (e.g. the application is being idle long enough), so the accessibility manager could do its work
    
    2021-07-23
    有用 1
    回复 1
    • 心有灵犀🍀
      心有灵犀🍀
      1天前
      你好,你说的重试是指appium动作吗?
      我是调用的find_element挂掉的,一旦发生这个错误,后面的操作都报这个错误。求指导
      1天前
      回复
  • 星期八
    星期八
    01-06

    请问这个问题解决了吗?求解

    01-06
    有用
    回复
  • MintBlue
    MintBlue
    2021-11-01

    我这边还是不行,这个问题现在有没有解决方案了?挺急的。。。

    2021-11-01
    有用
    回复 1
    • 菜刀~温暖🐰
      菜刀~温暖🐰
      2021-11-08
      你好,有解决方案了么?
      2021-11-08
      回复
  • 🙃
    🙃
    2021-06-03

    我的也是同样的问题,微信高版本的就获取不到pagesource了

    2021-06-03
    有用
    回复
  • 翱
    2021-05-26

    20210526遇到微信版本问题,切换uiautomator1,使用7.0.15可以正常访问元素

    2021-05-26
    有用
    回复
  • 阿Ben
    阿Ben
    2021-01-21

    [WD Proxy] Got response with status 500: {"sessionId":"c8d68fa1-b2e0-4017-af4c-1c6b96e6b2c9","value":{"error":"unknown error","message":"Timed out after 10000 milliseconds waiting for root AccessibilityNodeInfo","stacktrace":"io.appium.uiautomator2.common.exceptions.UiAutomator2Exception: Timed out after 10000 milliseconds waiting for root AccessibilityNodeInfo\n\tat io.appium.uiautomator2.utils.AXWindowHelpers.getActiveWindowRoot(AXWindowHelpers.java:78)\n\tat io.appium.uiautomator2.utils.AXWindowHelpers.getCachedWindowRoots(AXWindowHelpers.java:114)\n\tat io.appium.uiautomator2.core.AccessibilityNodeInfoDumper.toStream(AccessibilityNodeInfoDumper.java:178)\n\tat io.appium.uiautomator2.core.AccessibilityNodeInfoDumper.dumpToXml(AccessibilityNodeInfoDumper.java:202)\n\tat io.appium.uiautomator2.handler.Source.safeHandle(Source.java:38)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:41)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:257)\n\tat io.appium.uiautomator...

    [W3C] Matched W3C error code 'unknown error' to UnknownError

    [HTTP] <-- GET /wd/hub/session/08c4abeb-682b-4a21-8ff0-6b1099280bc1/source 500 15556 ms - 244

    [HTTP]

    还是有问题,求解。

    2021-01-21
    有用
    回复
登录 后发表内容
问题标签