如何使用appium获得ui automator查看器识别的属性?

如何使用appium获得ui automator查看器识别的属性?,appium,Appium,在设置了appium测试环境之后,我可以使用ui automator viewer工具获取屏幕截图,要测试的应用程序上有一个复选框。我想要的是在我的代码中获得复选框的“checked”属性,我尝试了“ele.GetAttribute(“checked”)”,但它不起作用,你能告诉我怎么做吗?appium的webelement支持什么属性名称吗?这个语法对我很有效 driver.findelement(By.className("<className>")).getAttribute(

在设置了appium测试环境之后,我可以使用ui automator viewer工具获取屏幕截图,要测试的应用程序上有一个复选框。我想要的是在我的代码中获得复选框的“checked”属性,我尝试了“ele.GetAttribute(“checked”)”,但它不起作用,你能告诉我怎么做吗?appium的webelement支持什么属性名称吗?

这个语法对我很有效

driver.findelement(By.className("<className>")).getAttribute("name")
driver.findelement(By.className(“”).getAttribute(“name”)