Appium的⼀些坑问题错误解决与技巧集锦
问题
1. error: Failed to start an Appium session, err was: Error: Requested a new session but one was in progress
之前的会话没有关闭,然后你⼜运⾏了实例,也没有设置覆盖.
解决:
1. 重新停⽌appium服务,开启Appium服务
2. 在Genarel Setting那⾥设置覆盖Session,重启Appium
测试结束在AfterClass加driver.quit()
2. error: Failed to start an Appium session, err was: Error: Command failed: C:\Windows\ /s /c "D:\android-sdk-windows\ -s adb server version (32) doesn't match this client (36); killing…
wait-for-device"
error: could not install smartsocket listener: cannot bind to 127.0.0.1:5037:
没有链接上⼿机或者模拟器,请确认已经连接成功,重新链接
3. error: Android devices must be of API level 17 or higher. Please change your device to Selendroid or upgrade Android on your device.
⼿机系统低于4.2,appium不⽀持4.2.2以下的系统,请换⼀个⼿机或者模拟器来测试。4. Error: Permission to start activity denied.
**activity在清单⽂件⾥⾯没添加Android:exported="true"的话,你不能直接打开对应的activity,需要从启动页activity打开。
exported属性就是设置是否允许activity被其它程序调⽤**
5. error: Failed to start an Appium session, err was: Error: Activity used to start app doesn't exist or cannot ve launched! Make usre it exists and is launchable activity
要打开的activity不存在,activity路径错误,改为完整正确的activity路径
6. error: Failed to start an Appium session, err was: Error: 'java -version' failed. Error: Command failed:
C:\Windows\ /s /c "java -version"
版本错误,请安装最新的版本。
7.> info: [debug] Error: Command failed:
C:\Windows\ /s /c "D:\android-sdk-windows\ -s 8806a0b0 shell "echo 'ready'"error: unknown host service
链接⼿机失败,重新链接⼿机即可,我就是重新拔插了⼀下usb
Error: Command failed: C:\Windows\ /s /c "D:\-sdk-windows\ -s 8806a0b0 shell "echo 'ping'""
error: unknown host service
adb被突然占⽤导致,例如你在运⾏⽤例的时候运⾏了模拟器。
8. UIAutomatorViewer提⽰: Unable to connect to adb. Check if adb is installed correctly
解决,sdk升级到了25产⽣的问题。
解决⽅法:
1. 将 复制⼀份到uiautomatorviewer.bat ⽬录下
w3mobile下载2. 修改uiautomatorviewer.bat⽂件最后⼀⾏(改binddir=%prog_dir%为⾃⼰的platform-tools本地路径)
9 error: Failed to start an Appium session, err was:INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling
When you are at final step to execute test automation script for mobile app testing on a mobile emulator or a virtual device or a real device, you might observe that script execution fails with different kinds of errors, In context to current article you will look at the
error and solutions for: INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论