现象:Appium运行脚本报错InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for this session,但是脚本里使用的定位元素方法为find_element_by_id()
 
原因:
 
根本原因1:电脑里安装的selenium版本和Appium-Python-Client版本不兼容
 
原因2:selenium版本之前是单独安装的3.12.0版本。Appium-Python-Client版本是通过Pycharm工具-settings- project Interpreter里安装的,安装时没有安装所对应匹配的selenium版本,导致版本不兼容
 
pycharm 里安装包的地点:
 
 
解决方法:
 
总结:从cmd里通过pip方法安装Appium-Python-Client时会同时安装正确对应的selenium版本(如果已经存在不兼容会卸载)。
 
方法:
 
1. Pycharm工具,先把Appium-Python-Client安装包卸载掉
 
2. 通过pip重新安装Appium-Python-Client

 
看截图里卸载掉了3.12.0,重新安装了selenium3.141.0版本。
 
3. 重新运行脚本,问题解决了
--------------------- 
作者:hou_angela 
来源:CSDN 
版权声明:本文为博主原创文章,转载请附上博文链接!

Appium 运行脚本报错InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for (转)的更多相关文章

  1. RobotFramework+Appium 升级Appium v1.10.0后,执行click element时报错:InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for this session,解决办法

    报错信息如下: debug] [35m[XCUITest][39m Connection to WDA timed out[debug] [35m[XCUITest][39m Connection t ...

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

  3. 关于Selenium.common.exceptions.WebDriverException: Message: Invalid locator strategy: css selector 的问题

    在执行脚本时报Selenium.common.exceptions.WebDriverException: Message: Invalid locator strategy: css selecto ...

  4. RF运行脚本报错:WebDriverException: Message: unknown error: call function result missing

    原因:浏览器驱动与浏览器版本不对应

  5. windows 2012执行powershell脚本报错

    使用powershell运行脚本报错:进行数字签名.无法在当前系统上运行该脚本.有关运行脚本和设置执行策略的详细信息 修复方法:powershell "Set-ExecutionPolicy ...

  6. shell脚本报错:"[: =: unary operator expected"

    shell脚本报错:"[: =: unary operator expected" 在匹配字符串相等时,我用了类似这样的语句: if [ $STATUS == "OK&q ...

  7. 解决执行sql脚本报错:没有足够的内存继续执行程序。

    出现执行sql脚本报错:没有足够的内存继续执行程序.是因为sql脚本过大,大家可能分为多个文件多次执行,这种笨方法可行,不过比较麻烦,大家可以用下面的方式,利用sqlcmd一次就行了:   执行cmd ...

  8. shell脚本报错:-bash: xxx: /bin/bash^M: bad interpreter: No such file or directory

    当我们把文件从windows系统中编辑的文件拷贝到linux系统中,如果我们执行文件会保存如下的错: shell脚本报错:-bash: xxx: /bin/bash^M: bad interprete ...

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

随机推荐

  1. seek()和tell()在文件里转移

    Seek()方法允许在输入和输出流移动到任意的位置,seek()有好几种形式.包含:seekp() 方法和seekg()方法,p是put的意思,g是get的意思:其中输入流里用seekg()函数,输出 ...

  2. Kubernetes 学习2 k8s基础概念

    一.架构描述 1.基本架构 2.pod ,有两类 a.自主式pod 自我管理的,创建之后,任然是需要提交给API Server,API Server接受之后然后由调度器调度到指定的 node节点,由n ...

  3. HeapAnalyzer分析工具

    HeapAnalyzer分析工具 由于jvisualvm或jmap生成的dump文件太大,常常需要用到dump文件分析工具对dump文件进行分析.HeapAnalyzer通过分析heapdump文件, ...

  4. java alibaba fastJson 遍历数组json

    import java.util.*; import com.alibaba.fastjson.*; public class Test { public static void main(Strin ...

  5. 为何.NET Core控制台项目发布后是一个dll文件,而不是exe文件?

    项目中有一个.NET Core控制台项目叫ConsoleCoreApp,写好代码后准备发布: 结果发布后生成的是一个dll文件...为不是一个exe的可执行文件: 后来了解到.NET Core的项目分 ...

  6. CSS块级元素与行内元素

    CSS块级元素与行内元素 行内元素与块状元素 1.块级元素:可以设置 width, height属性.  行内元素:设置width和height无效,其宽度随其元素的内容(文字或者图片等)的宽度而变化 ...

  7. 三、Shiro授权开发

    Shiro 支持三种方式的授权: I. 编程式:通过写if/else 授权代码块完成: Subject subject =SecurityUtils.getSubject(); if(subject. ...

  8. PhpStorm中实现代码自动换行

    方法一: 随便打开一个页面,在显示行号(最左边)这里鼠标右击,勾选"Use Soft Wraps". 方法二: 选择"File-->>Settings--&g ...

  9. 关于虚拟机linux网络的一个问题(基于cntos7)

    刚刚开始学习搭建Linux集群,目前出现的比较麻烦的一个问题是Linux网络ip问题.其实网上好多出现类似问题的解答大部分说是因为克隆的问题,但实际情况先克隆产生的问题应该是很好排查的.所幸,有博主针 ...

  10. Composer管理thinkphp版本

    安装Composer 下载 Composer 安装前请务必确保已经正确安装了 PHP.打开命令行窗口并执行 php -v 查看是否正确输出版本号. 打开命令行并依次执行下列命令安装最新版本的 Comp ...