For selecting things, I've found that allowing a "data-test='user-name-input'" type attribute is useful for a lot of cases, when doing Gauge/Taiko tests.
It might make sense to allow/recognize these to save trying to find things that way, rather than via CSS-type selectors that may change.
Totally! If you have data-test* attributes set up, we will use those first when generating selectors for each action. The full list of data-test attributes we use is listed here: https://reflect.run/docs/recording-tests/creating-resilient-.... If we don't find data-test* attributes we'll also look for other attributes that tend to have a good degree of specificity, like alt, rel, schema.org, and aria-* attributes.
I recomment considering learning between test runs and I encourage you to train a relatively simple model for selection on top of http-archive and tagged data.
"off the shelf" machine learning makes it pretty easy to create very robust selectors. I gave a talk about it in GDG Israel and was supposed to speak about it in HalfStack that got delayed cancelled because of COVID19 - but the principle is pretty simple.
Actually you can use the whole attribute name as selector, like data-test-user-name-input, and if you need a dynamic id, you can add as a value: data-test-product-item="book" ;)
It might make sense to allow/recognize these to save trying to find things that way, rather than via CSS-type selectors that may change.