appium+python自动化:获取元素属性get_attribute

使用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')


待探索

原文地址:https://www.cnblogs.com/Uni-Hoang/p/13764343.html