现象: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. Spring(十)之自定义事件

    编写自定义事件的简单流程如下: (1)编写CustomEvent.java package com.tutorialspoint; import org.springframework.context ...

  2. No active profile set, falling back to default profiles: default

    No active profile set, falling back to default profiles: default 这个错误是由于idea没有设置默认启动环境,设置即可

  3. Linux基础-3.用户、群组和权限

    1.用户及passwd文件 1)掌握/etc/passwd文件的功能:存储所有用户的相关信息,每一个用户占用一行记录,该文件也被称为用户信息数据库(Database) 2)/etc/passwd文件中 ...

  4. Windows 安装Redis程序

    一.系统环境 1.硬件系统:Windows7 64位 2.软件环境: Redis 64位 3.2.100.Redis Desktop Manager. 二.Redis安装 下载地址:https://g ...

  5. 基于 HTML5 Canvas 的拓扑组件开发

    在现在前端圈大行其道的 React 和 Vue 中,可复用的组件可能是他们大受欢迎的原因之一, 在 HT 的产品中也有组件的概念,不过在 HT 中组件的开发是依托于 HTML5 Canvas 的技术去 ...

  6. MQTT入门1 -- mosquitto 安装

    原文链接:https://www.cnblogs.com/NickQ/p/9247638.html MQTT入门1 -- mosquitto 安装 简介: MQTT(Message Queuing T ...

  7. restful api编写规范

    Node.js 除了用来编写 WEB 应用之外,还可以用来编写 API 服务,我们在本文中会介绍编写 Node.js Rest API 的最佳实践,包括如何命名路由.进行认证和测试等话题,内容摘要如下 ...

  8. 局域网,Internet,广域网

    局域网:覆盖范围小,自己花钱买设备,带宽固定,自己单位维护 网线100米以内 带宽10m 100m 1000m Internet:ISP,自己的机房,对网民提供访问Internet连接 广域网:距离远 ...

  9. 执行Go程序的三种方式及Go语言关键字

    执行 Go 程序的三种方式及 Go 语言关键字 执行 Go 程序的三种方式 一.使用 go run 命令 二.使用 go build 命令 Step1. 对 go 源码源文件执行 go build 命 ...

  10. GD32F450 200M时USB不稳定

    使用GD32F450的demo修改usb驱动,发现120M和168M时正常,200M时很不稳定.怀疑USB时钟分频有问题,一查果然是,记录如下: 200M是库函数主时钟分频代码如下 static vo ...