windows10下 python+appium自动化测试踩坑记录

目录

 

0x01 踩坑一 failed to start daemon

0x02 踩坑二 SessionNotCreatedException: Message: A new session could not be created. (Original error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.)

0x03 踩坑三 Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user

0x04 踩坑四 r: Failed to start an Appium session, err was: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "C:\Users\lenovo\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s 4f655297 shell "ps 'uiautomator'""

0x06 踩坑六 如何修改chromeoptions

0x07 踩坑七 ImportError: cannot import name 'InvalidArgumentException'

0x08 踩坑八 WebDriverException: Message: The URL '/wd/hub//session' did not map to a valid resource

0x09 踩坑九 KeyError: 'status'

0x10 踩坑十 http://dl-ssl.google.com/android上不去解决方案


0x01 踩坑一 failed to start daemon

原因:daemon使用的端口被其他进程占用

Microsoft Windows [版本 10.0.17134.829]
(c) 2018 Microsoft Corporation。保留所有权利。
C:\Users\lenovo>adb
Android Debug Bridge version 1.0.41
Version 29.0.1-5644136
Installed as C:\Users\lenovo\AppData\Local\Android\android-sdk\platform-tools\adb.exe
C:\Users\lenovo>adb devices
adb server version (31) doesn't match this client (41); killing...
could not read ok from ADB Server
* failed to start daemon
adb.exe: failed to check server version: cannot connect to daemon
C:\Users\lenovo>netstat -aon|findstr "5037"
  TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       5312
  TCP    127.0.0.1:5037         127.0.0.1:55443        ESTABLISHED     5312
  TCP    127.0.0.1:5037         127.0.0.1:55792        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:55837        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:55852        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:55857        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:55873        TIME_WAIT       0
#省略
C:\Users\lenovo>tasklist|findstr "5312"
LdsMobileLink.exe             5312 Console                    1     16,320 K
#在任务管理器中kill掉该进程
C:\Users\lenovo>adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
********        device

参考自:Android ADB Server启动失败

0x02 踩坑二 SessionNotCreatedException: Message: A new session could not be created. (Original error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root di

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值