zoukankan      html  css  js  c++  java
  • 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】,最终发现也是没用的,这里就不展开了~还是换个定位方式叭!

  • 相关阅读:
    nginx 负载均衡
    nginX 安装 启动
    nginx 简介
    使用ASDM 管理 ciscoASA设备
    OSPF配置实验(一)
    VRRP
    HSRP 详解
    Rip 动态路由协议
    配置ASA防火墙 远程管理方式
    Oracle 重启监听
  • 原文地址:https://www.cnblogs.com/poloyy/p/12922261.html
Copyright © 2011-2022 走看看