Appium问题解决方案(5)- selenium.common.exceptions.InvalidSelectorException: Message: Locator Strategy 'name' is not supported for this session
背景
使用Appium Server 1.15.1版本
执行了以下脚本
test = driver.find_element_by_name("自动化测试")
print(test.text)
报了以下错误
圈重点
selenium.common.exceptions.InvalidSelectorException: Message: Locator Strategy 'name' is not supported for this session
简译: by_name 这种定位元素方式已经不支持了
然后查了下资料,发现是在appium1.5之后, by_name 的这种定位方式已经彻底移除
解决方法一
最简单,不再用 by_name 定位方式了,改用id、class、xpath、accessibility id
解决方法二
看了网上的教程【driver.js】,最终发现也是没用的,这里就不展开了~还是换个定位方式叭!
Appium问题解决方案(5)- selenium.common.exceptions.InvalidSelectorException: Message: Locator Strategy 'name' is not supported for this session的更多相关文章
- selenium的报错信息:selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class names not permitted
报错信息:selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class ...
- Appium新版本遇到的问题,不能通过 name 去定位元素抛 Message: Locator Strategy 'name' is not supported for this session
环境: 1.Appium: 1.15.1 2.Python: 3.7.0 3.Selenium: 3.141.0 4.IDE: Pycharm 5.PC:Windows 10 问题:在 Pycharm ...
- 【Seleniuem】selenium.common.exceptions.InvalidSelectorException
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: An invalid or illega ...
- Appium问题解决方案(8)- selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not sign with default certificate.
背景 运行时代码报错: selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occ ...
- appium selenium.common.exceptions.WebDriverException: Message: Parameters were incorrect
selenium.common.exceptions.WebDriverException: Message: Parameters were incorrect. We wanted {" ...
- selenium.common.exceptions.WebDriverException: Message: unknown Error: cannot find Chrome binary
使用Chrome浏览器时,经常会遇到以下报错:浏览器没有调用起来 selenium.common.exceptions.WebDriverException: Message: unknown Err ...
- python + web自动化,点击不生效,提示“selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (117, 674)”
前言: 在做web自动化时,遇到一个缩放了浏览器比例的操作,从100%缩小到80%,再进行点击的时候,弹出报错信息,无法点击 selenium.common.exceptions.ElementCli ...
- selenium.common.exceptions.TimeoutException: Message: Screenshot: available via screen
在使用selenium+phantomjs的时候在Windows平台下能够正常工作,在Linux下却不能,并得到错误信息: selenium.common.exceptions.TimeoutExce ...
- selenium使用遇到的问题(selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.)
1.安装pip3 install selenium 2.使用browser=webdriver.Chrome()时报错 :selenium.common.exceptions.WebDriverExc ...
随机推荐
- Maven-内部多个项目依赖自动升级版本的部署
需要自动升级版本的AAA项目发布 (有内部依赖时) 步骤比较复杂, 有一些需要根据实际情况调整. 考虑了以下几种可能性: 依赖模块的版本有更新 依赖模块版本没更新 依赖模块的版本号: 直接定义, 用属 ...
- Python小白的数学建模课-16.最短路径算法
最短路径问题是图论研究中的经典算法问题,用于计算图中一个顶点到另一个顶点的最短路径. 在图论中,最短路径长度与最短路径距离却是不同的概念和问题,经常会被混淆. 求最短路径长度的常用算法是 Dijkst ...
- 除了Swagger UI,你还能选择 IGeekFan.AspNetCore.RapiDoc
IGeekFan.AspNetCore.RapiDoc 看到博客园上的这个文章,说了下Knife4J,评论里有人推荐RapiDoc,放了几个图,看了下,还不错. 心里 便有个想法,借着上次研究 Kni ...
- 自行搭建网站和APP统计平台
做过网站运营分析的朋友,一定知道 Google 统计.友盟统计以及百度统计,它们都是非常优秀的统计平台. 但不管怎么样,数据并没有掌握在网站拥有者的手中.有时候,某些业务场景不适合使用第三方统计平台, ...
- 记一次 .NET 某智慧水厂API 非托管内存泄漏分析
一:背景 1. 讲故事 七月底的时候有位朋友在wx上找到我,说他的程序内存占用8G,托管才占用1.5G,询问剩下的内存哪里去了?截图如下: 从求助内容看,这位朋友真的太客气了,动不动就谈钱,真伤感情, ...
- MySQL的函数使用
目录 COUNT()函数基本使用 SUM( )函数基本使用 AVG()函数基本使用 MAX()函数基本使用 MIN()函数基本使用 字符函数 concat()和concat_ws() LEFT()与R ...
- 运行第一个程序!hello world!
第一个程序:1 //打印 hello world 2 3 #include <stdio.h> 4 int main() 5 { 6 printf("hello world!\n ...
- Android菜鸟进字节跳动,居然是看了这个......
谈谈我的真实感受吧- 程序员真的是需要将终生学习贯彻到底的职业,一旦停止学习,离被淘汰,也就不远了. 金三银四.金九银十跳槽季,这是一个千年不变的话题,每到这个时候,很多人都会临阵磨枪,相信不快也光. ...
- 被字节跳动、小米、美团面试官问的AndroidFramework难倒了? 这里有23道面试真题,助力成为offer收割机!
目录 1.Android中多进程通信的方式有哪些?a.进程通信你用过哪些?原理是什么?(字节跳动.小米)2.描述下Binder机制原理?(东方头条)3.Binder线程池的工作过程是什么样?(东方头条 ...
- Spring Cloud Aliaba - Ribbon
Ribbon(有关介绍见RestTemplate末尾) Ribbon负载均衡实现策略 Ribbon负载均衡实现策略通过接口IRule进行实现,默认使用ZoneAvoidanceRule规则进行负载均衡 ...