appium问题整理
在刚进入appium的世界时,遇到无数的坑,趟过无数的浑水,现在整理一些常用的报错讯息,供大家参考
1.org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
错误可能原因:
1).appium服务未启动
2).appium服务地址写错
解决方法:
1).启动appium服务端
2).查看代码中服务端地址是否正确,若未修改,默认的地址为:http://127.0.0.1:4723/wd/hub
2. org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: The following desired capabilities are required, but were not provided: deviceName)
错误可能原因:
1).DesiredCapabilities 对象参数中缺少deviceName参数
2).参数deviceName 写错了,比如写成了 devicesName、devicename
解决方法:
查看代码中deviceName参数是否缺少或者是否写错,修正,重新运行
3. org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Bad app: C:\Users\Nick\Desktop\weixin.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat 'C:\Users\Nick\Desktop\weixin.apk')
错误可能原因:
1).apk路径写错了,导致程序未找到该apk
2).设置访问的是远程appium服务端,而apk路径却写成了本地地址
解决方法:
1).仔细检查apk路径
2).如果是远程appium服务端,app地址及app要写appium服务端上apk所在的路径
4. org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: No app set; either start appium with --app or pass in an 'app' value in desired capabilities, or set androidPackage to launch pre-existing app on device)
错误可能原因:
参数中即没有app参数,也没有appPackage参数
解决方法:
1).设置app参数,进行安装app然后测试
2).设置appPackage及appActivity参数,启动已安装的应用进行测试
5. org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity)
错误可能原因:
1).appActivity参数写错或者appPackage写错
2).设备上没安装这个app
解决方法:
1).检查appActivity参数值
2).检查设备是否安装了app
6. org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not find a connected Android device.)
错误可能原因:
当前没有设备在线,可进入cmd,输入adb devices查看是否有设备在线
解决方法:
插上设备或者检查设备连接是否有问题(可重启adb、重插设备、杀掉各种手机助手进程),若使用模拟器,可重启模拟器查看
7.org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress)
错误可能原因:
上次执行脚本没有正常关闭session
解决方法:
1).重启服务端后再执行脚本
2).等待session自动断开后再执行脚本
3).利用try catch finally块执行driver.quit()
4).勾选服务端的Override Existing Session参数,再下次执行脚本时会自动覆盖前面的session
appium问题整理的更多相关文章
- APPIUM API整理(python)---元素查找
最近在学习自动化框架appium,网上找一些API相关资料整理了一下 1.find_element_by_id find_element_by_id(self, id_): Finds element ...
- appium常用方法整理
1.相对坐标解锁九宫格 应用场景 QQ解锁屏幕如上,可见九个按键在同一个View下面,要实现解锁,用press moveTo release perform方法 实现代码如下: WebElem ...
- APPIUM API整理(python)---其他辅助类
App运行类 1.current_activity current_activity(self): 用法: print(driver.current_activity()) Retrieves the ...
- APPIUM API整理(python)---操作类
前言:android手机大家都很熟悉,操作有按键.触摸.点击.滑动等,各种操作方法可以通过api的方法来实现. 参考博文:http://blog.csdn.net/bear_w/article/det ...
- 【转】appium常用方法整理
1.相对坐标解锁九宫格 应用场景 QQ解锁屏幕如上,可见九个按键在同一个View下面,要实现解锁,用press moveTo release perform方法 实现代码如下: WebElem ...
- appium 方法整理
1.contexts contexts(self): Returns the contexts within the current session. 返回当前会话中的上下文,使用后可 ...
- Appium Android Bootstrap源码分析之简介
在上一个系列中我们分析了UiAutomator的核心源码,对UiAutomator是怎么运行的原理有了根本的了解.今天我们会开始另外一个在安卓平台上基于UiAutomator的新起之秀--Appium ...
- Appium Android Bootstrap源代码分析之简单介绍
在上一个系列中我们分析了UiAutomator的核心源代码,对UiAutomator是怎么执行的原理有了根本的了解.今天我们会開始另外一个在安卓平台上基于UiAutomator的新起之秀--Appiu ...
- appium python andiroid自动化文档整理笔记。
利用一天时间去整理appium for android文档.传送门 利用业余时间自己翻阅资料,google.百度等去查找,费劲一番功夫,最后终于成行了这篇文档. 也是作者对最近自己的学习的一个总结吧, ...
随机推荐
- JavaScript练习2
今天做了一些JS数组的练习题 一.往数组中插入一个数字 var attr = [1,2,3,4,5,6]; var c = 7; for(var i=0;i<attr.length;i++) { ...
- deeplearning.ai 卷积神经网络 Week 4 特殊应用:人脸识别和神经风格转换 听课笔记
本周课程的主题是两大应用:人脸检测和风格迁移. 1. Face verification vs. face recognition Verification: 一对一的问题. 1) 输入:image, ...
- bzoj:1299: [LLH邀请赛]巧克力棒
原题:http://www.lydsy.com/JudgeOnline/problem.php?id=1299 众多dalao的题解已经很详细了:http://blog.csdn.net/wzq_qw ...
- bzoj 1084;vijos 1191 [SCOI2005] 最大子矩阵
Description 这里有一个n*m的矩阵,请你选出其中k个子矩阵,使得这个k个子矩阵分值之和最大.注意:选出的k个子矩阵不能相互重叠. Input 第一行为n,m,k(1≤n≤100,1≤m≤2 ...
- bzoj:1656 [Usaco2006 Jan] The Grove 树木
Description The pasture contains a small, contiguous grove of trees that has no 'holes' in the middl ...
- 几道数位DP
因为这几天写的几道数位DP大多都太水..而且也确实没什么好讲所以就扔到一起了. [hdu4772]Good Numbers 要求统计区间内 各位数之和能被10整除 的数的个数. 练手,f[i][j][ ...
- 解决在SecurecCRT登录后,发现方向键、backspace(退格键)、delete(删除键)为乱码的问题
问题:使用securecrt ssh到linux之后,backspace(退格键),delete(删除键),以及4个方向键都为乱码,不能正常使用.按tab键也没有自动补全文件名. 即: 按Backsp ...
- Linux shell编程命令-Linux基础环境命令学习笔记
1.正则表达式 1)^开始 *前一个字符重复0次以上 + 1次以上 ? 0次或者1次 . 一个任意字符(.*连用) {m,n} m到n次 [0-9][a-z] 任意数字或字母 $结束字符 2)sed和 ...
- flume1.8 Sources类型介绍(二)
1 Flume Sources 1.1 Avro Source 监听Avro端口,从Avro client streams接收events.要求属性是粗体字. agent a1例子: ipFilter ...
- Qt 共享库(动态链接库)和静态链接库的创建及调用
前言: 编译器 Qt Creator, 系统环境 win7 64 位 1.创建共享库: 新建文件或项目->选择 Library 和 c++ 库->选择共享库->下一步(工程名为 sh ...