I’ve searched here and I’ve found just one answer regarding the issues regarding test automation and the dynamic nature of ID that are generated by Select2.
AFAIK at my company, we are using Select2 integrated with Bootstrap and for some Select2 uses we have got same findings done here -> https://medium.com/@kcmueller.
I’m preparing a webinar regarding test automation using TestCafe & TestCafe Studio and when trying to use this -> Select2 Github ChangeLog Page
as a playground, I’ve seen that on select with option groups id are created in what seems a random/dynamic way, making impossible any kind of automation that does not depends on finding/clicking things by position.
In addition, I’m not able to find documentation that explains how the ID of the main select2 element is generated. In Your page id is s2id_e1 for a plain select with id e1.
Then I’m very confused, because I’m not able to find documentation that will allow me to understand what is the algorithm used, if algorithm changes according the select characteristics: single selection, multiple selection, option groups.
Hope my explanation is clear.
Any option other to develop some kind of adapter, as I’ve read in the only post I’ve found regarding testautomation?
Thanks a lot