Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Android端控件树dump页面,支持通过快捷按钮将content-desc属性添加到控件元素信息 #245

Merged

Conversation

caofengbin
Copy link
Contributor

@caofengbin caofengbin commented May 14, 2023

Whether this PR is eventually merged or not, Sonic will thank you very much for your contribution.

无论此PR最终是否合并,Sonic组织都非常感谢您的贡献。

Checklist

  • The title starts with fix, fea, or doc. | 标题为fix、feat或doc开头。
  • I have checked that there are no duplicate pull requests with this request. | 我已检查没有与此请求重复的拉取请求。
  • I have considered and confirmed that this submission is valuable to others. | 我已经考虑过,并确认这份呈件对其他人很有价值。
  • I accept that this submission may not be used. | 我接受此提交可能不会被使用。

Description

Android端通过content-desc进行元素查找也比较常用,目前sonic平台录入元素的过程中,支持选择定位类型为accessibilityId,但是在控件树dump界面录入的时候,content-desc属性后没有增加的小箭头,这里简单优化支持下,效果如下:

截图_d104bf07-6d77-447b-936f-c6359502f038

点击后:

截图_0076f950-1b61-4d4a-9076-99270f8c3bc8

目前agent端是直接支持的,前端放出相关入口就好,自测正常。

@prlabeler prlabeler bot added the feature label May 14, 2023
@ZhouYixun
Copy link
Member

content-desc是跟accessibilityId一定对应的吗?这个我没了解过

稳一点感觉将content的xpath放上去好一点

@caofengbin
Copy link
Contributor Author

caofengbin commented May 14, 2023

content-desc是跟accessibilityId一定对应的吗?这个我没了解过

稳一点感觉将content的xpath放上去好一点

嗯,我这边了解的accessibilityId在Android上对应的是“content-desc”,之前用Appium的时候也是这么处理,在安卓上用的场景还比较多:
截图_4458be35-b6a8-498b-8bd5-120651c1516d

Making Your Appium Tests Fast and Reliable, Part 2: Finding Elements

如果将content的xpath放上去,感觉有点冗余,目前已经有xpath的字段能直接添加了。而且accessibilityId的查找性能也比xpath要高。

@ZhouYixun
Copy link
Member

测试过没问题对吗

Copy link
Member

@ZhouYixun ZhouYixun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mg

@ZhouYixun ZhouYixun merged commit 4a622a5 into SonicCloudOrg:main May 14, 2023
@caofengbin
Copy link
Contributor Author

测试过没问题对吗

嗯。我这边验证是ok的,agent端代码目前是可以直接支持的。

@caofengbin caofengbin deleted the feature/add_aid_in_remote_view branch May 17, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants