在刚进入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. flask-sqlalchemy使用命令创建数据库

    # 启动文件from flask_script import Manager,Server from flask_migrate import MigrateCommand,Migrate from ...

  2. Necklace(树状数组+离线操作)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3874 Necklace Time Limit: 15000/5000 MS (Java/Others) ...

  3. HDU--2024

    C语言合法标识符 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total S ...

  4. android手机安全卫士、Kotlin漫画、支付宝动画、沉浸状态栏等源码

    Android精选源码 轻量级底部导航栏   android手机卫士源码   android实现高仿今日头条源码   一个用Kotlin写的简单漫画App源码   android吐槽项目完整源码   ...

  5. c语言基础学习04

    =============================================================================涉及到的知识点有:程序的三种结构.条件分支语句 ...

  6. linux基本命令学习01

    =============================================================================Unix/Linux最主要的应用领域是基础服务 ...

  7. QQ群友在线/离线,如何测试?

    上篇文章『QQ好友在线/离线,如何测试?』针对即时通讯的"状态"进行了分析和总结,主要说到了QQ好友在线/离线实现方案,测试过程中需要注意的测试点. 针对好友状态实时性的要求需要使 ...

  8. [国嵌攻略][052][NandFlash驱动设计_读]

    NandFlash读数据方式 1.页读,读出页中主数据区的所有数据,提供页地址(行地址) 2.随机读,读出页中指定的存储单元的数据,提供页地址(行地址)和页内偏移(行地址) 代码编写 1.根据Nand ...

  9. javascript之fill()方法

    无意中看到fill这个方法,有些不解,起初以为是人家自定义的方法,后来才发觉原来不是,javascript里面是真的有这个方法,于是特地学习了下. fill()方法的作用是使用一个固定值来替换数组中的 ...

  10. node & grunt path处理相关

    在nodejs平台上写一些工具或者服务, 有很多需求会涉及到对目录或者文件路径的处理和操作.整理一些常用的处理path的方法 1.global __dirname Example: running n ...