让新版appium支持by_name定位
org.openqa.selenium.InvalidSelectorException: Locator Strategy 'name' is not supported for this session
1. 换其他定位方式,比如用xpath代替
2.不用换定位方式不用换之前脚本的方法来完成无缝升级appium版本的定位方式
修改源码解决问题,修改方法如下:
修改路径:
C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-driver\build\lib
修改文件:driver.js
只需要修改其中一行即可
this.locatorStrategies = ['xpath', 'id', 'class name', 'accessibility id', '-android uiautomator','name'];--------再此行代码中添加上name,如下

修改完成之后,保存文件,再次重启appium服务,就可以继续使用by_name定位
让新版appium支持by_name定位的更多相关文章
- 新版appium 支持name定位的方法(没试 记录再此)
查找路径:appium-desktop\resources\app\node_modules\appium\node_modules\appium-android-driver\build\lib 修 ...
- Appium新版本不再支持ByName定位了怎么办
appium版本在1.5以后就不再支持ByName的定位,本文章仅介绍在appium1.6.3/1.6.4/1.6.5版本下如何支持ByName定位,适用于安卓.在使用appium1.5之后的版本时, ...
- appium----新版appium 1.11.1 支持ByName定位
org.openqa.selenium.InvalidSelectorException: Locator Strategy 'name' is not supported for this sess ...
- Appium+Python3+iOS定位元素
前言: 最近在做IOS自动化测试,IOS的Appium环境都配置OK,执行起来真的慢,慢到怀疑人生,那么今天就来总结一下IOS定位方式和各个定位方式的速度排序. 据我观察,按查找元素的顺序速度,从快到 ...
- appium xpath元素定位
1.id定位 写法:driver.find_element_by_id("这里是resource-id") 2.name定位 name定位就是通过UI Automator工具查看的 ...
- 初探appium之元素定位(1)
无论是selenium还是appium,元素定位都是我们开始实现自动化面临的第一个问题.selenium还好,我们可以在浏览器的调试页面进行元素定位还是蛮方便的.那么appium怎么做呢? 我看到很多 ...
- 让IE6下支持固定定位
让IE下支持固定定位 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// ...
- appium 使用findElementByAndroidUIAutomator 定位元素示例
appium 使用findElementByAndroidUIAutomator 定位元素示例 import io.appium.java_client.remote.MobileCapability ...
- NB-IoT是怎么工作的,是否支持基站定位?【转】
转自:http://www.elecfans.com/iot/779658.html 根据我国无线电管理相关要求,明确NB-IoT系统基站应到到属地无线电管理机构办理设台审批,领取无线电台执照.同时, ...
随机推荐
- tomcat 发布后中文乱码问题
接口收到数据,使用Eclipse运行调试中文正常显示,发布到Tomcat后中文出现乱码情况: 解决方法: tomcat启动时默认使用系统编码,可更改tomcat bin目录下catalina.bat文 ...
- JSON和JSONP,浅析JSONP解决AJAX跨域问题
说到AJAX就会不可避免的面临两个问题,第一个是AJAX以何种格式来交换数据?第二个是跨域的需求如何解决?这两个问题目前都有不同的解决方案,比如数据可以用自定义字符串或者用XML来描述,跨域可以通过服 ...
- volatile和不加volatile的区别
http://blog.chinaunix.net/uid-25100840-id-3067899.html 对于一个地址,如果加上了volatile参数,这个地址也就不会经过编译器优化,也就是说这个 ...
- (转)android 中uri.parse()用法
1,调web浏览器 Uri myBlogUri = Uri.parse("http://xxxxx.com"); returnIt = new Intent(Intent.ACTI ...
- 安装pytorch成功但cuda不可用
贴上我看的教程https://zhuanlan.zhihu.com/p/26871672 一开始想用pycharm装pytorch,但不知道为什么一直失败.后来只能conda pip安装 但conda ...
- Preloading Your ASP.NET Applications
You may have noticed that the first request to an ASP.NET Web site takes longer than subsequent requ ...
- C# 时钟控件
//控件名:myNewClock //作者:刘典武 //时间:2011-06-10 using System; using System.Collections.Generic; using Syst ...
- 用纯c语言完成16位模式下的引导程序
gcc在16位模式下做引导程序遇到的问题太多了,不过费了很大劲逐一解决了. 自己的小demo也从一开始的1个扇区增加到了20几个扇区. 先上图做个标记,后面有时间再上代码.
- Koa,React和socket.io
安装 socket.io/socket.io-client 基本用法 首先koa和socket.io代码片段 const server = require('http'). const server ...
- IP池验证IP是否可用 及scrapy使用 ip池
简单验证 import requests url = "http://www.baidu.com/"proxies = {"http": "http: ...