id=popupY8cuUiMiDU is dynamic.I need to get the Y value from span but there are multiple listbox with the same span attribute taking Y option.
How can I select from listbox as there is no unique attribute?
There're a few options.
getting the element by what's not dynamic in its id
asking developers to build in a unique test id for you
e.g. there could be something like
data-test-id=popup, then you'd use a css selector like so:
There could be more options, you can get more creative etc. But I'd keep it as simple as possible, which promotes maintainability and readability.