背景

使用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. Podman 快速入门

    今天在某云上新购一台云服务器,发现已经有了 CentOS8.2 官方镜像可选,出于对新鲜事物的好奇,我决定开始采用 CentOS8.2,即使我还没有为它的新特性做好准备. 我的应用主要以单机版容器为主 ...

  2. noip模拟测试31

    终于有时间写博客了,前面一直咕咕咕都快变成一只公鸡了......这次考试,真的很意外,我在考场上觉得自己打出了T1的正解,样例一拍就过,还跑得嘎嘎快,然后T2,T3码了两个暴力,觉得自己应该能100p ...

  3. IDEA使用Tomcat时控制台乱码的解决方案>从零开始学JAVA系列

    IDEA使用Tomcat时控制台乱码的解决方案 解决方案1,修改启动时虚拟机参数 解决方案2,修改idea的设置 解决方案3,修改idea配置文件 在最后添加一行 '-Dfile.encoding=U ...

  4. 无法解析插件 org.apache.maven.plugins:maven-clean-plugin:2.5

    在Idea创建项目中,出现7出错误,告诉我 无法解析插件 org.apache.maven.plugins:maven-clean-plugin:2.5 但是在maven设置中都一致 后来加了几个镜像 ...

  5. ElasticSearch入门检索

    前面简介说到 elsatic是通过RestFul API接口操作数据的,可以通过postman模拟接口请求测试一下 一._cat 1.GET /_cat/nodes:查看所有节点 2.GET /_ca ...

  6. PCE | 华中农大郭亮团队蛋白质组学揭示油菜内源氧化还原修饰介导盐胁迫响应

    蛋白质翻译后修饰(PTM)在控制植物生长发育以及逆境适应方面发挥着重要的作用.发生在半胱氨酸巯基的亚磺酰化修饰(R-SOH)是一种可逆的氧化修饰类型,可以通过与其他修饰形态形成二硫键的形式来保护蛋白不 ...

  7. badboy如何录制jmetet脚本

    网盘下载: https://pan.baidu.com/s/1mTOEeE47tmk29_wndID3iw 傻瓜式安装即可, 内附教程 1. 打开Badboy, 新建一个文件 2.  输入要录制的网址 ...

  8. 【Android面试查漏补缺】之Handler详解,带你全面理解Handler消息机制

    在安卓面试中,关于 Handler 的问题是必备的,但是这些关于 Handler 的知识点你都知道吗? 一.题目层次 Handler 的基本原理 子线程中怎么使用 Handler MessageQue ...

  9. 为VIM添加Python扩展

    VIM的自带的脚本功能很强,但只能用在VIM自己上,如果让它支持Python脚本,那简直就无敌了,这个想法当然不是我想出来的,应该说英雄所见略同,于是乎vim7.2就内建了对python2.4的支持, ...

  10. moco模拟接口具体操作

    1.get请求 [ { "description": "模拟一个没有参数的get请求", "request": { "uri&qu ...