appium+python自动化:获取元素属性get_attribute(python appium定位元素)

网友投稿 491 2022-09-02


appium+python自动化:获取元素属性get_attribute(python appium定位元素)

使用get_attribute()获取元素属性,括号里应该填写什么?

查看appium源码

如果是获取resource-id,填写resourceId

​​self.driver.find_element(MobileBy.XPATH, "//*[contains(@resource-id,'followed_btn')]").get_attribute('resourceId')​​

如果是获取text,填写text,不是name,这是不准确吗?

​​self.driver.find_element(MobileBy.XPATH, "//*[contains(@resource-id,'followed_btn')]").get_attribute('text')​​

待探索


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:聊聊SpringBoot使用Nacos进行服务注册发现与配置管理问题
下一篇:python 函数高级功能(python基础教程)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~