mercredi 1 avril 2020

UI Automation - Elements on my UI have ember ids , which change frequently with addition of new UI elements. How to use the id for automation?

Example of the HTML of a dropdown element:

    <div aria-owns="ember-basic-dropdown-content-ember1234" tabindex="0" data-ebd-id="ember1234-trigger" role="button" id="ember1235" class="ember-power-select-trigger ember-basic-dropdown-trigger ember-view">  <!---->
    <span class="ember-power-select-status-icon"></span>
    </div>

The xpath and CSS selector also contain the same ember id. xpath : //*[@id="ember1235"] css selector : #ember1235

The ember id would change from id="ember1235" to say, id="ember1265" when there is a change in the UI.

I am using id to locate the element. But every time it changes I need to modify the code. Is there any other attribute I could use for Ember JS UI elements?




Aucun commentaire:

Enregistrer un commentaire