Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法将自定义属性添加到工具栏按钮/自定义工具栏按钮?
我正在做一些测试,我需要通过自定义属性获取这些按钮。
谢谢
目前没有办法,不,虽然我们考虑过让我们的测试更容易编写。
目前我们使用aria-label查找按钮(例如 querySelector for button[aria-label="Remove link"])虽然这确实意味着我们的测试只能以一种语言运行。
aria-label
button[aria-label="Remove link"]