appium 切换到webview context后报错
来源:互联网 发布:matlab矩阵最大值位置 编辑:程序博客网 时间:2024/06/07 17:21
错误1: chrome not reachable
解决办法:原文链接
修改Appium安装目录下的文件,例如:
D:\Program Files\Appium\node_modules\appium\lib\devices\android\android-hybrid.js
找到androidHybrid.startChromedriverProxy 函数,注释掉相关内容。
androidHybrid.startChromedriverProxy = function (context, cb) { cb = _.once(cb); logger.debug("Connecting to chrome-backed webview"); if (this.chromedriver !== null) { return cb(new Error("We already have a chromedriver instance running")); } //if (this.sessionChromedrivers[context]) { // in the case where we've already set up a chromedriver for a context, // we want to reconnect to it, not create a whole new one // this.setupExistingChromedriver(context, cb); //} else { this.setupNewChromedriver(context, cb); //}};
问题原因:
Appium第一次切换到Html页面时,会新生成一个Chromedriver;当第二次切换到Html时,会使用已经存在的Chromedriver。但其实在我们的应用里面每次打开一个Activity时一般都是会重新创建一个WebChromeClient,所以这里就把它改成无论如何都生成一个新的Chromedriver。
另外一个问题:修改源码后不起作用,需要重新编译。目前没找打编译方法。一个workround:切换为webview后,重新切换回native_app前杀死chromdriver进程。
错误2:no such session
解决方法:
查看手机端系统内核chrom版本: 设置—应用管理–全部—Android System Webview。点击进入查看版本。chrome与chromedriver对应关系
chromedriver下载地址:http://chromedriver.storage.googleapis.com/index.html
下载对应的chromedriver后替换appium自带的chromdirver。路径:appium安装路径\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe
注:
双击执行“chromedriver.exe”,可以查看版本driver版本号;
- appium 切换到webview context后报错
- Appium切换到webview
- appium之Context切换
- Appium测试Android混合应用时,第二次切换到WebView时的定位问题
- appium 切换到webview Chrome version must be >= 59.0.3071.0\n
- appium切换webview时卡住问题
- appium 切换到 webview 下,执行 webview 下的第二次操作时,proxying chromedriver 的 session 请求无响应
- Android 真机,微信打开 H5,切换到 webview,能通过 webdriver 方法操作页面元素,然后链接到新的 H5 页面后,无法操作元素,appium 服务器没有收到 response,
- Appium - WebView测试(Android)
- Appium - WebView测试(Android)
- Appium - WebView测试(Android)
- appium webview H5 测试
- python+appium切换微信端的webview。新建测试交流群651385084
- Appium 切换Webview模式,页面还停留在原来页面的问题
- Appium Hybrid混合应用测试——Native切换WebView(转)
- Python Appium 输入法切换
- appium混合测试切换
- appium-webview应用的测试
- python django 原生sql 获取数据
- JanusGraph之Configuration Reference
- 第十章:创建计算字段
- windows下搭建基于nginx的rtmp服务器
- SQL Server数据库学习之 -- 常用语句一
- appium 切换到webview context后报错
- PLSQL导出导入数据库对象操作详解
- Rxjava 实现倒计时的方法
- JSP编程,url中加斜杠和不加斜杠的区别
- BZOJ1070: [SCOI2007]修车
- Git必须掌握的基本操作
- https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
- Android studio运行单元测试报错: Class Not Found: Empty Test Suite
- java基础---多线程