现象: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. 第2章 K近邻算法

    numpy中的tile函数: 遇到numpy.tile(A,(b,c))函数,重复复制A,按照行方向b次,列方向c次. >>> import numpy >>> n ...

  2. 验证码帮助类【CaptchaHelper 】

    GDI+:Graphics Device Interface Plus也就是图形设备接口,提供了各种丰富的图形图像处理功能;在C#.NET中,使用GDI+处理二维(2D)的图形和图像,使用Direct ...

  3. Discuptor入门(二)-实例

    前言:最近在项目中看到有人使用的discuptor框架,因为没有接触过所以网上找了些资料.但最终发现开荒者太少,好像没什么人用那.最后感觉还是官方入门文档靠谱点.所以自己翻译了下(翻译器~),希望能帮 ...

  4. react项目 使用echarts

    1.安装 npm install --save echarts-for-react //如果需要使用echarts的一些特殊方法需要安装 npm install --save echarts 2.使用 ...

  5. php 二位数组排序

    $member_ship_level 是一个二维数组 $res = array_column($member_ship_level,'integral'); array_multisort($res, ...

  6. Field Security Profile Helper

    using System; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Messages; /// <summary> /// 安全字 ...

  7. hive表查询中文显示乱码

    hive在查询表信息时,中文显示乱码,数字或者url显现null问题解决思路. 1.确定create hive表时指定的row format delimited fields terminated b ...

  8. go语言 os.Rename() cannot move the file to a different disk drive 怎么办

    时值我小病在家休养生息,喜欢跳广场舞的外公来寻求我的帮助,他们跳广场舞是将存有歌曲的U盘插到音响上面,而音响大部分都是只能显示歌曲的索引index,不能直接显示歌曲名,所以为了方便他们会在U盘里面对歌 ...

  9. scala 求数组排序后每两个元素的差值

    求数组排序后每两个元素的差值 例如数组 1,5,8,10,2 求得结果为 1,3,3,2 一般什么样的场景会有这种需求呢? 比如 计算一堆数据在一定时间内的计算时延, 或者得到这段时间内数据的平均计算 ...

  10. Hadoop HA高可用集群搭建(2.7.2)

    1.集群规划: 主机名        IP                安装的软件                            执行的进程 drguo1  192.168.80.149 j ...