使用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】,最终发现也是没用的,这里就不展开了~还是换个定位方式叭!
原文:https://www.cnblogs.com/poloyy/p/12922261.html