测试人社区

Appium: android对应UI自动化报错,怎么解决???????

android对应UI自动化报错
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


对应启动配置:

    platformName : 'android'
    udid: 'emulator-5554'
    deviceName: 'emulator-5554'
    restart: true
    package: com.dedao.juvenile
    activity: com.dedao.juvenile.business.splash.SplashActivity
    automationName: UiAutomator2
    noReset: True
    enableWebviewDetailsCollection: True
    autoGrantPermissions: True
    unicodeKeyboard: True
    resetKeyboard: True
    newCommandTimeout: 3600
    uiautomator2ServerLaunchTimeout: 36000
    appWaitDuration: 36000

具体appium_log:

[2020-12-24 20:26:28,391] [logging:log_info] [INFO]- [HTTP] {"using":"xpath","value":"//android.widget.LinearLayout/android.view.ViewGroup[1]/android.view.ViewGroup"}
[2020-12-24 20:27:28,398] [logging:log_info] [INFO]- [WD Proxy] Error: timeout of 240000ms exceeded
[2020-12-24 20:27:28,399] [logging:log_info] [INFO]- [WD Proxy]     at createError (/usr/local/lib/node_modules/appium/node_modules/_axios@0.21.0@axios/lib/core/createError.js:16:15)
[2020-12-24 20:27:28,399] [logging:log_info] [INFO]- [WD Proxy]     at RedirectableRequest.handleRequestTimeout (/usr/local/lib/node_modules/appium/node_modules/_axios@0.21.0@axios/lib/adapters/http.js:264:16)
[2020-12-24 20:27:28,399] [logging:log_info] [INFO]- [WD Proxy]     at Object.onceWrapper (events.js:421:26)
[2020-12-24 20:27:28,399] [logging:log_info] [INFO]- [WD Proxy]     at RedirectableRequest.emit (events.js:314:20)
[2020-12-24 20:27:28,399] [logging:log_info] [INFO]- [WD Proxy]     at ClientRequest.eventHandlers.<computed> (/usr/local/lib/node_modules/appium/node_modules/_follow-redirects@1.13.1@follow-redirects/index.js:13:24)
[2020-12-24 20:27:28,416] [logging:log_info] [INFO]- [WD Proxy]     at ClientRequest.emit (events.js:314:20)
[2020-12-24 20:27:28,416] [logging:log_info] [INFO]- [WD Proxy]     at Socket.emitRequestTimeout (_http_client.js:716:9)
[2020-12-24 20:27:28,416] [logging:log_info] [INFO]- [WD Proxy]     at Object.onceWrapper (events.js:420:28)
[2020-12-24 20:27:28,417] [logging:log_info] [INFO]- [WD Proxy]     at Socket.emit (events.js:326:22)
[2020-12-24 20:27:28,417] [logging:log_info] [INFO]- [WD Proxy]     at Socket._onTimeout (net.js:484:8)
[2020-12-24 20:27:28,417] [logging:log_info] [INFO]- [WD Proxy]     at listOnTimeout (internal/timers.js:554:17)
[2020-12-24 20:27:28,417] [logging:log_info] [INFO]- [WD Proxy]     at processTimers (internal/timers.js:497:7)

appium有个caps参数设置一下最大超时时间。newCommandTimeout 时间单位是s