会话未创建例外:无法创建新会话:Appium

时间:2017-09-24 16:56:36

标签: appium

org.openqa.selenium.SessionNotCreatedException:无法创建新会话。 (原始错误:命令失败:C:\ Windows \ system32 \ cmd.exe / s / c“”C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb.exe“-s 69c7aa170104 install “C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ unlock_apk \ unlock_apk-debug.apk”“

日志:

  

info: - > POST / wd / hub / session {“capabilities”:[{“desiredCapabilities”:{“browserName”:“chrome”,“platformName”:“Android”,“version”:“7.0”,“deviceName”:“我的手机”, “平台”: “ANDROID”}},{ “requiredCapabilities”:{}}], “desiredCapabilities”:{ “browserName”: “铬”, “platformName”: “机器人”, “版本”: “7.0” ,“deviceName”:“我的手机”,“平台”:“ANDROID”},“requiredCapabilities”:{}}   info:客户端用户代理字符串:Apache-HttpClient / 4.5.3(Java / 1.8.0_131)   info:[debug]提供了以下所需功能,但appium无法识别。它们将被传递给在此服务器上运行的任何其他服务。 :版本,平台   info:设置模式:直接进入Chromedriver   info:[debug]看起来我们想要android上的chrome   info:[debug]创建新的appium会话9390ac8f-f774-4181-83be-ec947d3f381d   info:[debug]检查adb是否存在   info:[debug]使用来自C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb.exe的adb   info:[debug]使用快速重置?真正   info:[debug]准备会话设备   info:[debug]不检查app是否存在,因为我们假设它已经在设备上   info:检索设备   info:[debug]试图找到一个连接的Android设备   info:[debug]获取连接设备...   info:[debug]执行cmd:“C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb.exe”设备   info:[debug] 1个设备已连接   info:找到设备69c7aa170104   info:[debug]将设备ID设置为69c7aa170104   info:[debug]等待设备准备就绪并响应shell命令(timeout = 5)   info:[debug]执行cmd:“C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb.exe”-s 69c7aa170104 wait-for-device   info:[debug]执行cmd:“C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb.exe”-s 69c7aa170104 shell“echo'ready'”   info:[debug]启动logcat捕获   info:[debug]将解锁帮助应用程序推送到设备...   info:[debug]执行cmd:“C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb.exe”-s 69c7aa170104 install“C:\ Program Files(x86)\ Appium \ node_modules \ appium \编译\ unlock_apk \ unlock_apk-debug.apk”   info:[debug]清理appium会话   错误:无法启动Appium会话,错误是:错误:命令失败:C:\ Windows \ system32 \ cmd.exe / s / c“”C:\ Program Files(x86)\ Android \ android-sdk \ platform- tools \ adb.exe“-s 69c7aa170104 install”C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ unlock_apk \ unlock_apk-debug.apk“”   无法安装C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ unlock_apk \ unlock_apk-debug.apk:失败[INSTALL_CANCELED_BY_USER]

     

info:[debug]错误:命令失败:C:\ Windows \ system32 \ cmd.exe / s / c“”C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb。 exe“-s 69c7aa170104 install”C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ unlock_apk \ unlock_apk-debug.apk“”   无法安装C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ unlock_apk \ unlock_apk-debug.apk:失败[INSTALL_CANCELED_BY_USER]

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
     

info:[debug]以错误响应客户端:{“status”:33,“value”:{“message”:“无法创建新会话。(原始错误:命令失败:C:\ Windows \ system32 \ cmd.exe / s / c \“\”C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb.exe \“-s 69c7aa170104 install \”C:\ Program Files( x86)\ Appium \ node_modules \ appium \ build \ unlock_apk \ unlock_apk-debug.apk \“\”\ n无法安装C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ unlock_apk \ unlock_apk-debug.apk :失败[INSTALL_CANCELED_BY_USER] \ r \ n)“,”kill“:false,”code“:1,”signal“:null,”cmd“:”C:\ Windows \ system32 \ cmd.exe / s / c \ “\”C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb.exe \“-s 69c7aa170104 install \”C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ unlock_apk \ unlock_apk-debug.apk \“\”“,”origValue“:”命令失败:C:\ Windows \ system32 \ cmd.exe / s / c \“\”C:\ Program Files(x86)\ Android \ android-sdk \ platform-tools \ adb.exe \“ - s 69c7aa170104 install \”C:\ Program Files(x86)\ Appium \ node_modules \ a ppium \ build \ unlock_apk \ unlock_apk-debug.apk \“\”\ n无法安装C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ unlock_apk \ unlock_apk-debug.apk:失败[INSTALL_CANCELED_BY_USER] \ r \ n \ n “},” 的sessionId“:空}   info:< - POST / wd / hub / session 500 11882.982 ms - 1223

1 个答案:

答案 0 :(得分:0)

这里提到的DesiredCapabilities没有得到满意的参数来启动新的Appium Session。请检查平台'您要在哪里运行此脚本。记录清楚地说。

Log: The following desired capabilities were provided, but not recognized by appium.They will be passed on to any other services running on this server. : version, platform info: Set mode: Proxying straight through to Chromedriver info