报错

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


appium log:

[WD Proxy] Error: timeout of 240000ms exceeded
[WD Proxy]     at createError (C:\Users\user\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\axios\lib\core\createError.js:16:15)
[WD Proxy]     at ClientRequest.handleRequestTimeout (C:\Users\user\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\axios\lib\adapters\http.js:256:16)
[WD Proxy]     at Object.onceWrapper (events.js:291:20)
[WD Proxy]     at ClientRequest.emit (events.js:208:15)
[WD Proxy]     at Socket.emitRequestTimeout (_http_client.js:680:40)
[WD Proxy]     at Object.onceWrapper (events.js:291:20)
[WD Proxy]     at Socket.emit (events.js:203:13)
[WD Proxy]     at Socket._onTimeout (net.js:434:8)
[WD Proxy]     at listOnTimeout (internal/timers.js:531:17)
[WD Proxy]     at processTimers (internal/timers.js:475:7)
[MJSONWP (211db10d)] Encountered internal error running command: UnknownError: 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
[MJSONWP (211db10d)]     at JWProxy.command (C:\Users\user\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:280:13)
[MJSONWP (211db10d)]     at processTicksAndRejections (internal/process/task_queues.js:85:5)
[HTTP] <-- POST /wd/hub/session/211db10d-0ea4-4ec8-a73f-3e4d45faefcd/element 500

代码很普通:

WebDriverWait(driver, _TIMING_OUT).until(lambda x: x.find_elements(*self.locator))
element = driver.find_element(*self.locator)
return element.get_attribute("text")

出现的地方不是固定的,有时候是 a 元素,有时候是 b 元素,请问大家遇到过吗?


↙↙↙阅读原文可查看相关链接,并与作者交流