在刚进入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问题整理的更多相关文章

  1. APPIUM API整理(python)---元素查找

    最近在学习自动化框架appium,网上找一些API相关资料整理了一下 1.find_element_by_id find_element_by_id(self, id_): Finds element ...

  2. appium常用方法整理

    1.相对坐标解锁九宫格 应用场景 QQ解锁屏幕如上,可见九个按键在同一个View下面,要实现解锁,用press   moveTo  release  perform方法 实现代码如下: WebElem ...

  3. APPIUM API整理(python)---其他辅助类

    App运行类 1.current_activity current_activity(self): 用法: print(driver.current_activity()) Retrieves the ...

  4. APPIUM API整理(python)---操作类

    前言:android手机大家都很熟悉,操作有按键.触摸.点击.滑动等,各种操作方法可以通过api的方法来实现. 参考博文:http://blog.csdn.net/bear_w/article/det ...

  5. 【转】appium常用方法整理

    1.相对坐标解锁九宫格 应用场景 QQ解锁屏幕如上,可见九个按键在同一个View下面,要实现解锁,用press   moveTo  release  perform方法 实现代码如下: WebElem ...

  6. appium 方法整理

    1.contexts contexts(self):     Returns the contexts within the current session.     返回当前会话中的上下文,使用后可 ...

  7. Appium Android Bootstrap源码分析之简介

    在上一个系列中我们分析了UiAutomator的核心源码,对UiAutomator是怎么运行的原理有了根本的了解.今天我们会开始另外一个在安卓平台上基于UiAutomator的新起之秀--Appium ...

  8. Appium Android Bootstrap源代码分析之简单介绍

    在上一个系列中我们分析了UiAutomator的核心源代码,对UiAutomator是怎么执行的原理有了根本的了解.今天我们会開始另外一个在安卓平台上基于UiAutomator的新起之秀--Appiu ...

  9. appium python andiroid自动化文档整理笔记。

    利用一天时间去整理appium for android文档.传送门 利用业余时间自己翻阅资料,google.百度等去查找,费劲一番功夫,最后终于成行了这篇文档. 也是作者对最近自己的学习的一个总结吧, ...

随机推荐

  1. [转]python变量作用域的有趣差别

    func()里 可以访问全局变量i,但不能给i重新赋值. i = 1 def func(): print( i + 1) func() # 2 用global声明后,可以给i重新赋值. i = 1 d ...

  2. Modelsim独立仿真Vivado Clocking Wizard IP Core

    工欲善其事,必先利其器.在使用Vivado自带的仿真软件仿真的时候,相对于更优秀的仿真工具Modelsim,效率低了很多,为了更高效的开发,我尝试着用Vivado级联Modelsim仿真,但是级联后还 ...

  3. excel数据导出新妙招

    之前在做项目的时候需要将数据库中的数据导出为excel表格一遍打印查阅,在网上找了很多插件也没有找到自己理想的好用的插件(也就是说没有找到令我满意的插件),最近在学习a标签的相关知识时理解到,a标签不 ...

  4. nagios与zabbix对比

    nagios与zabbix对比 web功能: Nagios简单直观,报警与数据都在同一页面,***.红色即为问题项.Nagios web端不要做任何配置. Zabbix监控数据与报警是分开的,查看问题 ...

  5. python 元组学习

    元组用tuple表示,用,分割开,和列表类似,但是没有排序修改等高级操作.简单地说就是终态的...... >>> tuple1 = (1,2,3)>>> type( ...

  6. Windows 部署 Redis 群集(转)

    1,下载Redis for windows 的最新版本,解压到 c:\Redis 目录下备用https://github.com/MSOpenTech/redis/releases当前我使用的是 3. ...

  7. linux 下CentOS 下 npm命令安装gitbook失败的问题

    运行环境 linux 服务器:CentOS 7.0 系统:安装了nodejs :使用 npm 安装 gitbook 出现错误提示: npm install -g gitbook-cli symbol ...

  8. ::在c++中什么意思

    (1)表示“域操作符” 例:声明了一个类A,类A里声明了一个成员函数void f(),但没有在类的声明里给出f的定义,那么在类外定义f时, 就要写成void A::f(),表示这个f()函数是类A的成 ...

  9. jquery ui-----弹出窗口 dialog

    jquery ui 提供了强大的dialog功能,基本能满足开发的功能. 先上一个简单的例子: [代码] <script> $(function() {   $( "#dialo ...

  10. Java Reflection(getXXX和getDeclaredXXX)

    package com.sunchao.reflection; public class Person { private int age ; private String name; public ...