没有启动手机 app 这个问题也解决了
我这 wda 真机测试启动 app 失败 能帮忙看下嘛?
debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.shenqihudong.game.yycs","arguments":[],"environment":{},"shouldWaitForQuiescence":true}}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"6C76A6BD-F273-4326-8837-50BCED74E9DB","value":"Failed to launch com.shenqihudong.game.yycs application","status":13}
[debug] [XCUITest] Failed to create WDA session. Retrying...```
对了 还有 你这 appium1.6.3 版本在哪里下载的?官网只有 1.4 吧 windows
你好,我想问下,appium 使用 uiautomator2 需要安装什么插件吗?我这边使用 uiautomator2 没效果
这个问题解决了,是 caps 的一个参数设置错误了。 还有另一个问题,创建 wda 失败,没有启动手机 app。这个可能是什么原因
有没有知道呢?help me
adb devies 有添加设备吗?
#28 楼 @Lihuazhang 那就解决了,谢了。还是基础知识不够。谢了
#26 楼 @chenhengjie123 啥意思? appium 可不会自动去跑 adb connect 命令 , 需要我提前连接好?
#24 楼 @Lihuazhang usb 连接不会这样, 我试试加些日志,这边用的是 rf 脚本,我还不太熟悉。我先看看,有啥结果我晚点发上来
#22 楼 @Lihuazhang 现在就是找不到问题在哪呀
#20 楼 @Lihuazhang 拿不到设备可能是啥原因呢? 毕竟使用 adb 命令没有问题
No appActivity desired capability or server param. Parsing from apk
脚本没定义 activity 名称,appium 会自动从 apk 里面解析获取,会不会是我的 apk 访问不了?
#17 楼 @Lihuazhang
不能把?我手机一直处在亮屏状态,不会休眠。而且我也试了很多次,都是这样
#11 楼 @chenhengjie123
#12 楼 @Lihuazhang
现在看着方便了吗? 还有啥问题? 我看了下别人的帖子,排版没太大问题了吧?
#12 楼 @Lihuazhang
对呀 ,就是这个问题,为啥连不上呢? 我用 adb 连没有问题的呀
D:\AppData\Local\Android\sdk>adb connect 192.168.1.7:5555
connected to 192.168.1.7:5555
D:\AppData\Local\Android\sdk>adb devices
List of devices attached
192.168.1.7:5555 device
D:\AppData\Local\Android\sdk>adb shell
shell@CP8722:/ $ exit
D:\AppData\Local\Android\sdk>adb disconnect 192.168.1.7:5555
disconnected 192.168.1.7:5555
D:\AppData\Local\Android\sdk>adb devices
List of devices attached
给,排版真对不住了 脚本我也重新发下
*** Settings ***
Library AppiumLibrary run_on_failure=Capture Screenshot On Failure
*** Variables ***
${SCREENSHOTS} ${EXECDIR}${/}screenshots${/}
${REMOTE_URL} http://localhost:4723/wd/hub
${APP_PACKAGE} com.bitbar.testdroid
${AUTOMATION_NAME} appium
${PLATFORM_NAME_ANDROID} Android
${PLATFORM_VERSION_ANDROID} 6.0.1 # Uncomment this from the 'Open Application' keyword if you want to be spesific
${DEVICE_NAME_ANDROID} 192.168.1.7:5555 # IP address?
#${DEVICE_NAME_ANDROID} 192.168.1.22:5555 # IP address?
#${DEVICE_NAME_ANDROID} 106.37.252.16:10003 # IP address?
${APP_ANDROID} ${CURDIR}${/}app${/}BitbarSampleApp.apk
#${APP_ANDROID} ${PROJECTROOT}${/}application.apk
${PLATFORM_NAME_IOS} ios
${PLATFORM_VERSION_IOS} 9.0.2 # Uncomment this from the 'Open Application' keyword if you want to be spesific
${DEVICE_NAME_IOS} iOS Emulator # IP address?
${APP_IOS} ${CURDIR}${/}app${/}BitbarIOSSample.ipa
${AUTO_ACCEPT_ALERTS} true
*** Keywords ***
Set Up And Open Android Application
Open Application ${REMOTE_URL} platformName=${PLATFORM_NAME_ANDROID} deviceName=${DEVICE_NAME_ANDROID} app=${APP_ANDROID} automationName=${AUTOMATION_NAME} appPackage=${APP_PACKAGE}
... #platformVersion=${PLATFORM_VERSION_ANDROID}
Wait Until Page Contains What is the best way to test your application 5s
Set Up And Open Ios Application
Open Application ${REMOTE_URL} platformName=${PLATFORM_NAME_IOS} deviceName=${DEVICE_NAME_IOS} app=${APP_IOS} automationName=${AUTOMATION_NAME} appPackage=${APP_PACKAGE}
... autoAcceptAlerts=${AUTO_ACCEPT_ALERTS} #platformVersion=${PLATFORM_VERSION_IOS}
Wait Until Page Contains What is the best way to test your application 5s
Capture Screenshot On Failure
Capture Page Screenshot ${SCREENSHOTS}${/}${TEST NAME}.png
info: --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"deviceName":"192.168.1.7:5555","app":"D:\\ridepro\\robot-framework-demoapp-example3\\resources\\app\\BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"}}
info: Client User-Agent string: Python-urllib/2.7
info: [debug] No appActivity desired capability or server param. Parsing from apk.
2017-02-10 05:40:11:114 - [HTTP] --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"deviceName":"106.37.252.16:10002","app":"/home/alex/workspace/robot-framework-demoapp-example/resources/app/BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"}}
2017-02-10 05:40:11:119 - [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"deviceName":"106.37.252.16:10002","app":"/home/alex/workspace/robot-framework-demoapp-example/resources/app/BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"},{},null,null,null]
info: --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"deviceName":"192.168.1.7:5555","app":"D:\ridepro\robot-framework-demoapp-example3\resources\app\BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"}}
info: Client User-Agent string: Python-urllib/2.7
info: [debug] No appActivity desired capability or server param. Parsing from apk.
info: [debug] Using local app from desired caps: D:\ridepro\robot-framework-demoapp-example3\resources\app\BitbarSampleApp.apk
info: [debug] Creating new appium session a1a6edce-53c8-463d-98d5-796bdc213f62
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_31
info: [debug] Checking whether adb is present
info: [debug] Using adb from D:\AppData\Local\Android\sdk\platform-tools\adb.exe
info: [debug] Parsing package and activity from app manifest
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from D:\AppData\Local\Android\sdk\build-tools\25.0.1\aapt.exe
info: [debug] Extracting package and launch activity from manifest.
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\build-tools\25.0.1\aapt.exe dump badging D:\ridepro\robot-framework-demoapp-example3\resources\app\BitbarSampleApp.apk
info: [debug] badging package: com.bitbar.testdroid
info: [debug] badging act: com.bitbar.testdroid.BitbarSampleApplicationActivity
info: [debug] Parsed package and activity are: com.bitbar.testdroid/com.bitbar.testdroid.BitbarSampleApplicationActivity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Could not find devices, restarting adb server...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Could not find devices, restarting adb server...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Could not find devices, restarting adb server...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Could not find devices, restarting adb server...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Error: Could not find a connected Android device.
at [object Object].ADB.getDevicesWithRetry (D:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:606:15)
at [object Object].androidCommon.prepareActiveDevice (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:400:12)
at [object Object].<anonymous> (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:326:26)
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:607:21
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:246:17
at iterate (D:\Appium\node_modules\appium\node_modules\async\lib\async.js:146:13)
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:157:25
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:248:21
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:612:34
at [object Object].androidCommon.ensureDeviceLocale (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:371:45)
at [object Object].androidCommon.prepareEmulator (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:364:10)
at [object Object].<anonymous> (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:325:26)
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:607:21
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:246:17
at iterate (D:\Appium\node_modules\appium\node_modules\async\lib\async.js:146:13)
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:157:25
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:248:21
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:612:34
at [object Object].<anonymous> (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:344:9)
at FSReqWrap.oncomplete (fs.js:95:15)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not find a connected Android device.)","origValue":"Could not find a connected Android device."},"sessionId":null}
info: <-- POST /wd/hub/session 500 28002.968 ms - 206
error: Failed to start an Appium session, err was: Error: Could not find a connected Android device.
#9 楼 @chenhengjie123
### 论坛我也是刚来,排版实在用的不熟悉,对不住了
### 失败的:
POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"deviceName":"192.168.1.7:5555","app":"D:\ridepro\robot-framework-demoapp-example3\resources\app\BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"}}
[debug] No appActivity desired capability or server param. Parsing from apk
### 成功的:
POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"deviceName":"106.37.252.16:10002","app":"/home/alex/workspace/robot-framework-demoapp-example/resources/app/BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"deviceName":"106.37.252.16:10002","app":"/home/alex/workspace/robot-framework-demoapp-example/resources/app/BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"},{},null,null,null]
### 有没有可能是没有执行 [MJSONWP] Calling AppiumDriver.createSession() with args
### 我再附上所有的日志
info: --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"deviceName":"192.168.1.7:5555","app":"D:\ridepro\robot-framework-demoapp-example3\resources\app\BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"}}
info: Client User-Agent string: Python-urllib/2.7
info: [debug] No appActivity desired capability or server param. Parsing from apk.
info: [debug] Using local app from desired caps: D:\ridepro\robot-framework-demoapp-example3\resources\app\BitbarSampleApp.apk
info: [debug] Creating new appium session a1a6edce-53c8-463d-98d5-796bdc213f62
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_31
info: [debug] Checking whether adb is present
info: [debug] Using adb from D:\AppData\Local\Android\sdk\platform-tools\adb.exe
info: [debug] Parsing package and activity from app manifest
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from D:\AppData\Local\Android\sdk\build-tools\25.0.1\aapt.exe
info: [debug] Extracting package and launch activity from manifest.
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\build-tools\25.0.1\aapt.exe dump badging D:\ridepro\robot-framework-demoapp-example3\resources\app\BitbarSampleApp.apk
info: [debug] badging package: com.bitbar.testdroid
info: [debug] badging act: com.bitbar.testdroid.BitbarSampleApplicationActivity
info: [debug] Parsed package and activity are: com.bitbar.testdroid/com.bitbar.testdroid.BitbarSampleApplicationActivity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Could not find devices, restarting adb server...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Could not find devices, restarting adb server...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Could not find devices, restarting adb server...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Could not find devices, restarting adb server...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 0 device(s) connected
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Error: Could not find a connected Android device.
at [object Object].ADB.getDevicesWithRetry (D:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:606:15)
at [object Object].androidCommon.prepareActiveDevice (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:400:12)
at [object Object]. (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:326:26)
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:607:21
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:246:17
at iterate (D:\Appium\node_modules\appium\node_modules\async\lib\async.js:146:13)
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:157:25
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:248:21
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:612:34
at [object Object].androidCommon.ensureDeviceLocale (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:371:45)
at [object Object].androidCommon.prepareEmulator (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:364:10)
at [object Object]. (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:325:26)
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:607:21
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:246:17
at iterate (D:\Appium\node_modules\appium\node_modules\async\lib\async.js:146:13)
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:157:25
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:248:21
at D:\Appium\node_modules\appium\node_modules\async\lib\async.js:612:34
at [object Object]. (D:\Appium\node_modules\appium\lib\devices\android\android-common.js:344:9)
at FSReqWrap.oncomplete (fs.js:95:15)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not find a connected Android device.)","origValue":"Could not find a connected Android device."},"sessionId":null}
info: <-- POST /wd/hub/session 500 28002.968 ms - 206
error: Failed to start an Appium session, err was: Error: Could not find a connected Android device.
#4 楼 @Lihuazhang 脚本我也发下 哈哈 新手 测试脚本
*** Settings ***
Library AppiumLibrary run_on_failure=Capture Screenshot On Failure
*** Variables ***
${SCREENSHOTS} ${EXECDIR}${/}screenshots${/}
${REMOTE_URL} http://localhost:4723/wd/hub
${APP_PACKAGE} com.bitbar.testdroid
${AUTOMATION_NAME} appium
${PLATFORM_NAME_ANDROID} Android
${PLATFORM_VERSION_ANDROID} 6.0.1 # Uncomment this from the 'Open Application' keyword if you want to be spesific
${DEVICE_NAME_ANDROID} 192.168.1.7:5555 # IP address?
#${DEVICE_NAME_ANDROID} 192.168.1.22:5555 # IP address?
#${DEVICE_NAME_ANDROID} 106.37.252.16:10003 # IP address?
${APP_ANDROID} ${CURDIR}${/}app${/}BitbarSampleApp.apk
#${APP_ANDROID} ${PROJECTROOT}${/}application.apk
${PLATFORM_NAME_IOS} ios
${PLATFORM_VERSION_IOS} 9.0.2 # Uncomment this from the 'Open Application' keyword if you want to be spesific
${DEVICE_NAME_IOS} iOS Emulator # IP address?
${APP_IOS} ${CURDIR}${/}app${/}BitbarIOSSample.ipa
${AUTO_ACCEPT_ALERTS} true
*** Keywords ***
Set Up And Open Android Application
Open Application ${REMOTE_URL} platformName=${PLATFORM_NAME_ANDROID} deviceName=${DEVICE_NAME_ANDROID} app=${APP_ANDROID} automationName=${AUTOMATION_NAME} appPackage=${APP_PACKAGE}
... #platformVersion=${PLATFORM_VERSION_ANDROID}
Wait Until Page Contains What is the best way to test your application 5s
Set Up And Open Ios Application
Open Application ${REMOTE_URL} platformName=${PLATFORM_NAME_IOS} deviceName=${DEVICE_NAME_IOS} app=${APP_IOS} automationName=${AUTOMATION_NAME} appPackage=${APP_PACKAGE}
... autoAcceptAlerts=${AUTO_ACCEPT_ALERTS} #platformVersion=${PLATFORM_VERSION_IOS}
Wait Until Page Contains What is the best way to test your application 5s
Capture Screenshot On Failure
Capture Page Screenshot ${SCREENSHOTS}${/}${TEST NAME}.png
能收到各位的回复很是开心,谢谢,但还没解决,麻烦大拿能继续指导
#3 楼 @chenhengjie123 我用 adb 命令执行
D:\AppData\Local\Android\sdk>adb connect 192.168.1.7:5555
connected to 192.168.1.7:5555
D:\AppData\Local\Android\sdk>adb devices
List of devices attached
192.168.1.7:5555 device
ip 端口没有问题 ,下面我发下我失败的日志,和别人成功的日志,可能存在问题的地方 ,麻烦帮我看下
失败日志:> info: --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"deviceName":"192.168.1.7:5555","app":"D:\ridepro\robot-framework-demoapp-example3\resources\app\BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"}}
info: Client User-Agent string: Python-urllib/2.7
info: [debug] No appActivity desired capability or server param. Parsing from apk
成功日志:2017-02-10 05:40:11:114 - [HTTP] --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"deviceName":"106.37.252.16:10002","app":"/home/alex/workspace/robot-framework-demoapp-example/resources/app/BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"}}
2017-02-10 05:40:11:119 - [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"deviceName":"106.37.252.16:10002","app":"/home/alex/workspace/robot-framework-demoapp-example/resources/app/BitbarSampleApp.apk","platformName":"Android","automationName":"appium","appPackage":"com.bitbar.testdroid"},{},null,null,null]
有没有可能是没有执行 [MJSONWP] Calling AppiumDriver.createSession() with args
失败这是 No appActivity desired capability or server param. Parsing from apk
有知道问题麻烦指导下,急