摘要
GetAttribute 实际上从字面上我们就能够明白,它是获取元素的一些属性。类似于文本内容,类名,resourId等。当然还包括了一些属性状态,如clickable,checkable等等,
正文
GetAttribute的代码其实挺简单的 我们来看下吧
public AndroidCommandResult execute(final AndroidCommand command)
throws JSONException {
if (command.isElementCommand()) {
// only makes sense on an element
final Hashtable<String, Object> params = command.params();
try {
final AndroidElement el = command.getElement();
final String attr = params.get("attribute").toString();
if (attr.equals("name") || attr.equals("text")
|| attr.equals("className") || attr.equals("resourceId")) {
return getSuccessResult(el.getStringAttribute

-GetAttribute&spm=1001.2101.3001.5002&articleId=48200155&d=1&t=3&u=ae21eb79c5f648e689e7449c5ccea079)
7003

被折叠的 条评论
为什么被折叠?



