Appium python appium 用例里截图时遇到一个调用截图抛的异常 return base64.b64decode(self.get_screenshot_as_base64().encode('ascii'))

麻辣蚕豆 · 2023年03月02日 · 4499 次阅读

求问下 有人遇到过没

在 appium 里调试 也频繁遇到截图时 报错 screenshot no body 的返回 一直在转圈

  self.device.get_screenshot_as_file(img_path)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 1032, in get_screenshot_as_file
    png = self.get_screenshot_as_png()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 1064, in get_screenshot_as_png
    return base64.b64decode(self.get_screenshot_as_base64().encode('ascii'))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 1074, in get_screenshot_as_base64
    return self.execute(Command.SCREENSHOT)['value']
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/appium/webdriver/errorhandler.py", line 31, in check_response
    raise wde
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/appium/webdriver/errorhandler.py", line 26, in check_response
    super().check_response(response)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded

共收到 0 条回复 时间 点赞
麻辣蚕豆 关闭了讨论 12月28日 13:06
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册