Appium:从渲染器接收消息超时:10.000 在 Browserstack 中获取旧设备的屏幕截图

问题描述

我正在研究 Web 应用程序的自动化,我需要获取屏幕截图以处理页面上的画布元素。我在 browserstack 中执行此操作,它适用于现代设备(即三星 galaxy S21),但有时会在某些旧设备(即三星 galaxy S7)上失败。

我使用以下方法制作屏幕截图:

driver.get_screenshot_as_png()

然后我收到错误

Timed out receiving message from renderer: 10.000

Appium 日志:

2021-06-17 22:17:02:552 - [HTTP] --> GET /wd/hub/session/43129c47-0a16-46d0-8b57-c66cc8edddb1/screenshot
2021-06-17 22:17:02:552 - [HTTP] {}
2021-06-17 22:17:02:552 - [MJSONWP (43129c47)] Driver proxy active,passing request on via HTTP proxy
2021-06-17 22:17:02:552 - [debug] [WD Proxy] Matched '/wd/hub/session/43129c47-0a16-46d0-8b57-c66cc8edddb1/screenshot' to command name 'getScreenshot'
2021-06-17 22:17:02:552 - [debug] [WD Proxy] Proxying [GET /wd/hub/session/43129c47-0a16-46d0-8b57-c66cc8edddb1/screenshot] to [GET http://127.0.0.1:18082/wd/hub/session/140c5eb0b3fc3fa325b6695431d4c596/screenshot] with body: {}
2021-06-17 22:18:11:365 - [debug] [WD Proxy] Got response with status 200: {"sessionId":"140c5eb0b3fc3fa325b6695431d4c596","status":21,"value":{"message":"timeout: Timed out receiving message from renderer: 10.000\n  (Session info: chrome=89.0.4389.105)\n  (Driver info: chromedriver=89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294}),platform=Linux 4.1.13-101.fc21.x86_64 x86_64)"}}
2021-06-17 22:18:11:366 - [debug] [MJSONWP (43129c47)] Encountered internal error running command: ProxyRequestError: Could not proxy command to Remote Server. Original error: The request to /wd/hub/session/43129c47-0a16-46d0-8b57-c66cc8edddb1/screenshot has Failed
2021-06-17 22:18:11:366 - [debug] [MJSONWP (43129c47)]     at JWProxy.proxy (/nix/store/gx8i2dvj27brp6xqn7gma10zk8b5643y-appium-1.17.0/node_modules/appium-uiautomator2-driver/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:218:13)
2021-06-17 22:18:11:366 - [debug] [MJSONWP (43129c47)]     at ProtocolConverter.convertAndProxy (/nix/store/gx8i2dvj27brp6xqn7gma10zk8b5643y-appium-1.17.0/node_modules/appium-uiautomator2-driver/node_modules/appium-base-driver/lib/jsonwp-proxy/protocol-converter.js:245:12)
2021-06-17 22:18:11:366 - [debug] [MJSONWP (43129c47)]     at JWProxy.proxyCommand (/nix/store/gx8i2dvj27brp6xqn7gma10zk8b5643y-appium-1.17.0/node_modules/appium-uiautomator2-driver/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:254:12)
2021-06-17 22:18:11:366 - [debug] [MJSONWP (43129c47)]     at JWProxy.proxyReqRes (/nix/store/gx8i2dvj27brp6xqn7gma10zk8b5643y-appium-1.17.0/node_modules/appium-uiautomator2-driver/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:304:36)
2021-06-17 22:18:11:366 - [debug] [MJSONWP (43129c47)]     at Chromedriver.proxyReq (/nix/store/gx8i2dvj27brp6xqn7gma10zk8b5643y-appium-1.17.0/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/lib/chromedriver.js:683:9)
2021-06-17 22:18:11:366 - [debug] [MJSONWP] Matched JSONWP error code 21 to TimeoutError
2021-06-17 22:18:11:367 - [HTTP] <-- GET /wd/hub/session/43129c47-0a16-46d0-8b57-c66cc8edddb1/screenshot 500 68816 ms - 347

是否可以增加此超时?或任何其他解决我问题的建议。

附言我尝试使用 driver.set_script_timeoutdriver.set_page_load_timeout 增加超时时间,但对我没有效果

我的配置:

Appium-Python-Client==1.1.0

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)