react-component / react-component/menu
id="rc-menu-uuid-*" 破坏了自动化脚本的执行
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 701
- Forks
- 266
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 3
Description
用 Selenium IDE / UI.Vision / SideeX 录制的自动化脚本会优先使用 id 选择器,生成的 selector 如下:
//ul[@id='rc-menu-uuid-82370-17-business-page-popup']/li[2]/span[1]/a[1]
其中 "82370-17" 是随机生成的数字,录制的脚本运行时会重新打开页面,生成不同的随机数,导致录制的脚本找不到对应的元素,测试脚本运行失败。
请问下为什么会考虑在 id 属性里添加 uuid 随机数呢?可以换成使用 data-* 的自定义属性吗?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the menu code that generates the rc-menu-uuid-* IDs and reproduce the recorded Selenium IDE, UI.Vision, or SideeX selector failure after a page reload. Done means the automation scenario no longer depends on a regenerated numeric ID, with the chosen selector behavior verified by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100