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.百度等去查找,费劲一番功夫,最后终于成行了这篇文档. 也是作者对最近自己的学习的一个总结吧, ...
随机推荐
- cs231n spring 2017 lecture9 CNN Architectures 听课笔记
参考<deeplearning.ai 卷积神经网络 Week 2 听课笔记>. 1. AlexNet(Krizhevsky et al. 2012),8层网络. 学会计算每一层的输出的sh ...
- 通过例子理解 k8s 架构 - 每天5分钟玩转 Docker 容器技术(122)
为了帮助大家更好地理解 Kubernetes 架构,我们部署一个应用来演示各个组件之间是如何协作的. 执行命令 kubectl run httpd-app --image=httpd --replic ...
- isdigit函数
isdigit是计算机应用C语言中的一个函数,主要用于检查参数c是否为阿拉伯数字0到9. 相关函数 isdigit 表头文件 #include <ctype.h>(C语言),#includ ...
- bzoj 1084;vijos 1191 [SCOI2005] 最大子矩阵
Description 这里有一个n*m的矩阵,请你选出其中k个子矩阵,使得这个k个子矩阵分值之和最大.注意:选出的k个子矩阵不能相互重叠. Input 第一行为n,m,k(1≤n≤100,1≤m≤2 ...
- 2017 Multi-University Training Contest - Team 1 1002&&HDU 6034 Balala Power!【字符串,贪心+排序】
Balala Power! Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)T ...
- linux下vi编辑某文件时,操作出现 错误提示: E325: ATTENTION 2, Found a swap file by the name ".p1.c.swp"
当我在linux下用vi打开p1.c文件时 root@iZ2zeeailqvwws5dcuivdbZ:~/1/01/指针# vi p1.c 会出现如下信息: E325: ATTENTION Found ...
- UEP-弹窗给选中数据赋值
弹窗给选中数据赋值:t/** * 设置分派员 */ function onDispatchMan(){ var rec=ajaxgrid.getCheckedRecords(); if(rec.len ...
- [国嵌攻略][119][Linux中断处理程序设计]
裸机中断: 1.中断统一入口. 2.注册中断处理程序. 3.根据中断源编号,调用中断处理程序. Linux中断 1.在entry-armv.S中的_irq_svc是中断统一入口. 2.获取产生中断源的 ...
- 浏览器与CDN缓存行为
@地址栏回车 1. 未过期: 浏览器拦截,直接返回: (expires/cache-control两个参数决定,如果两个参数都有,cache-control覆盖expires); 2. 已过期: et ...
- 算法-java代码实现插入排序
插入排序