背景

使用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的更多相关文章

  1. selenium的报错信息:selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class names not permitted

    报错信息:selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class ...

  2. 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 ...

  3. 【Seleniuem】selenium.common.exceptions.InvalidSelectorException

    selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: An invalid or illega ...

  4. 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 ...

  5. appium selenium.common.exceptions.WebDriverException: Message: Parameters were incorrect

    selenium.common.exceptions.WebDriverException: Message: Parameters were incorrect. We wanted {" ...

  6. selenium.common.exceptions.WebDriverException: Message: unknown Error: cannot find Chrome binary

    使用Chrome浏览器时,经常会遇到以下报错:浏览器没有调用起来 selenium.common.exceptions.WebDriverException: Message: unknown Err ...

  7. 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 ...

  8. selenium.common.exceptions.TimeoutException: Message: Screenshot: available via screen

    在使用selenium+phantomjs的时候在Windows平台下能够正常工作,在Linux下却不能,并得到错误信息: selenium.common.exceptions.TimeoutExce ...

  9. 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 ...

随机推荐

  1. Linux下-LNMP环境搭建博客网站(全过程)

    通常我们所说的LNMP是指一个网站基本的组织框架,即Linux系统支持,Nginx静态服务,Mysql数据库支持以及PHP动态编程语言支持.目前Mysql数据库被Oracle数据库分析公司收购,其创始 ...

  2. CF559B Equivalent Strings TJ

    前言 题目传送门 正解:模拟,递归. 考试的 T4,还是想复杂了 qwq. 这题不要用 STL,容易 \(\texttt{TLE}\)!! 题意简述 翻译够简了. 对了给一下样例解释的翻译: 第一个样 ...

  3. Java面向对象09——super

    Super  main ​ package oop.demon01.demon05; ​ public class Application {     public static void main( ...

  4. String s="a"+"b"+"c",到底创建了几个对象?

    首先看一下这道常见的面试题,下面代码中,会创建几个字符串对象? String s="a"+"b"+"c"; 如果你比较一下Java源代码和反 ...

  5. 微信小程序开发——后端Java(一)

    一.前言 最近接触了小程序的开发,后端选择Java,因为小程序的代码运行在腾讯的服务器上,而我们自己编写的Java代码运行在我们自己部署的服务器上,所以一开始不是很明白小程序如何与后台进行通信的,然后 ...

  6. Mysql使用存储过程快速添加百万数据

    前言 为了体现不加索引和添加索引的区别,需要使用百万级的数据,但是百万数据的表,如果使用一条条添加,特别繁琐又麻烦,这里使用存储过程快速添加数据,用时大概4个小时. 创建一个用户表 CREATE TA ...

  7. NOIP 模拟 $12\; \text{简单的填数}$

    题解 一个纯的贪心,被我搞成 \(dp\) 了,最后把错解删掉了,骗了 \(10pts\) 考虑如何贪心,设置一种二元组 \((x,l)\),\(x\) 表示当前值,\(l\) 表示当前最长连续长度. ...

  8. HBuilder mui 手机app开发 Android手机app开发 ios手机app开发

    经过一段时间的学习,做公司项目,对mui框架有了更加深入完整的了解,其实刚开始接触HBuilder中的mui框架只是简单的了解,并没有深入的研究,后来由于工作的需求,不得不深入研究,并运用的项目中去. ...

  9. WPF LiveChart 图表详解

    //参考网址:https://www.cnblogs.com/zh7791/p/12617961.html 本文主要介绍LiveChart.WPF 中的图表的使用方法 类: 数据绑定, 数据显示样式等 ...

  10. ASP.NET Core:依赖注入

    ASP.NET Core的底层设计支持和使用依赖注入.ASP.NET Core应用程序可以利用内置的框架服务将它们注入到启动类的方法中,并且应用程序服务能够配置注入.由ASP.NET Core提供的默 ...