在刚进入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. 我的第一个spring_boot项目

    springBoot火了有一段时间了,现在才接触,着实没跟上节奏.. 一.创建项目并跑起来 目的很简单,只要配置好springBoot环境,并成功启动,且能访问到我项目下的任一资源即可 1 下载mav ...

  2. 加载进度圈,带遮罩层(jquery)

    如图: Js下载地址:http://files.cnblogs.com/files/holdon521/cvi_busy_lib.js 如下使用实例: <script src="/st ...

  3. deeplearning.ai 人工智能行业大师访谈 Yoshua Bengio 听课笔记

    1. 如何走上人工智能的研究的?Bengio说他小时候读了很多科幻小说,1985年(64年出生,21岁)研究生阶段开始阅读神经网络方面的论文,对这个领域产生了热情. 2. 如何看深度学习这些年的发展? ...

  4. Saving James Bond(dijk)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1245 Saving James Bond Time Limit: 6000/3000 MS (Java ...

  5. HDU 1232 畅通工程(模板——并查集)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1232 Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出 ...

  6. Oracle_子查询

    Oracle_子查询 子查询   --如何查得所有比"CLARK"工资高的员工的信息 select ename, sal from emp where ename = 'CLARK ...

  7. c++---天梯赛---N个数求和

    ★题目: ★难点:要求只能以有理数和分数去输出结果. ★分析:可以对输入的数据进行通分处理,随后把结果按格式输出. ★代码: #include<iostream> #include< ...

  8. 记node前后端代码共用的一次坑

    项目背景 nodejs项目,webpack打包,用axios请求,Promise封装,nunjucks模板引擎: 之前已将nunjucks模板通过webpack打包策略,做成前后端共用: 目前需要将网 ...

  9. Mysql中的force index和ignore index

    前几天统计一个sql,是一个人提交了多少工单,顺便做了相关sql优化.数据大概2000多w. ) c order by c desc; 为了实验最少受其他因素干扰,将生产库的200多w数据导出来,用测 ...

  10. diffMerge安装配置使用

    概述: 在用git进行源代码版本维护的时候,常常会进行各代码版本之前区别的查看,例如在每次提交改动前进行git diff 可以看到源文件代码相对相应版本或是远程仓库的改动情况,如果有冲突还需要进行me ...