Appium中元素定位的注意点

应用场景

了解这些注意点可以以后在出错误的时候,更快速的定位问题原因。

示例

使用 find_element_by_xx 或 find_elements_by_xx 的方法,分别传入一个没有的"特征"会是什么结果呢?

核心代码

driver.find_element_by_id("xxx")

driver.find_elements_by_id("xxx")

小结

1.如果使用 find_element_by_xx方法,如果传入一个没有的特征,会报NoSuchElementException的错误。

2.如果使用 find_elements_by_xx方法,如果传入一个没有的特征,不会报错,会返回一个空列表

相关推荐
阿祖_in_coding3 天前
混合App(Hybrid App)自动化测试理解
appium
returnthem11 天前
安装Appium
appium
seabirdssss16 天前
Appium 在小米平板上的安装受限与闪退排查
android·appium·电脑
小陈的进阶之路19 天前
Selenium 滑动 vs Appium 滑动
python·selenium·测试工具·appium
小陈的进阶之路20 天前
Appium 自动化测试笔记
笔记·appium
linglan42821 天前
APPium环境配置
appium·自动化
lifewange1 个月前
Appium是什么
appium·压力测试
柚子+1 个月前
Appium+python+雷电模拟器自动化测试入门
数据库·python·appium
@Aurora.2 个月前
【GUI自动化测试】--基于QQ音乐项目的GUI自动化测试
appium