-
Notifications
You must be signed in to change notification settings - Fork 172
Daydream generates extreme selectors #21
Comments
@kokujin Do you have a better idea for ensuring a unique path to the element? I'm sure there's a smarter way to do it, just haven't had time to think it over. |
Maybe it would be smart to introduce a configuration where you can specify how the selectors will be calculated? With options like:
|
I think that would open a can of worms @michalbe , It would be best it it would just automatically generate the shortest, most optimized selector. Think about the scenario of allowing non technical users in a QA department. |
Have you thought about using a third party lib to generate the electors @stevenmiller888 ? for example, https://www.npmjs.com/package/css-selector-generator, from the description:
|
https://github.com/autarc/optimal-select is also an option to generate short selectors |
Not sure if the first one is a good choice, apparently the lib has some infinite loops bugs inside. There is a benchmark for this already: css-selector-generator-benchmark |
RE @michalbe I'd love to also specify a black list of selectors. |
@stevenmiller888 the pull request #32 has already solved this and I think this can be closed. In all my testing I haven't experienced any issues with long selectors. |
Is there a way to shorten the selectors generated by Daydream? Or a way to let Daydream know when to generate relative selector paths? Here is a snippet of a generated click:
This was generated by clicking the "issues" link in this github repositoty:
This is huge und unnecessary. Any ideas? Thanks
The text was updated successfully, but these errors were encountered: