场景:
1.有 400 个 case 要运行,每运行完一个 case 就 Appium.Driver.quit();运行完下一个 case 重新创建 session;
问题:
每次大概只运行 10~20 左右的 case,然后 Appium.js 就报异常,异常如下:
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Requested a new session but one was in progress)","origV
ested a new session but one was in progress"},"sessionId":"054b890c-da26-49db-a906-af84b01443ef"}
info: <-- POST /wd/hub/session 500 1.575 ms - 250
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"D:/apps/ContactManager/elong_5.3.5.apk","platform":"WINDOWS","platformName":"Android","deviceName":"emulator-5554","browserName
pp-package":"com.dp.android.elong","device":"Android","app-activity":".HomeActivity","version":"4.4"}}
info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
error: Failed to start an Appium session, err was: Error: Requested a new session but one was in progress
info: [debug] Error: Requested a new session but one was in progress
at Appium.start (C:\Users\dd.haong\AppData\Roaming\npm\node_modules\appium\lib\appium.js:127:15)
at Object.exports.createSession [as handle] (C:\Users\dd.haong\AppData\Roaming\npm\node_modules\appium\lib\server\controller.js:182:16)
at next_layer (C:\Users\dd.haong\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:113:13)
at Route.dispatch (C:\Users\dd.haongAppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:117:5)
at C:\Users\dd.haong\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:222:24
at Function.proto.process_params (C:\Users\dd.haong\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:288:12)
at next (C:\Users\dd.haong\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:216:19)
at next (C:\Users\dd.haong\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:180:38)
at next (C:\Users\dd.haong\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:180:38)
at next (C:\Users\dd.haong\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:180:38)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Requested a new session but one was in progress)","origV
ested a new session but one was in progress"},"sessionId":"054b890c-da26-49db-a906-af84b01443ef"}
info: <-- POST /wd/hub/session 500 1.489 ms - 250