I am working with Selenium and need to get the ID of a control but the ID is dynamic and I can't get it.
<em id="button-1122-btnWrap">
<button id="button-1122-btnEl" class="x-btn-center" autocomplete="off" role="button" disabled="disabled" hidefocus="true" type="button" style="width: 21px; height: 21px;">
<span id="button-1122-btnInnerEl" class="x-btn-inner" style="width: 21px; height: 21px; line-height: 21px;"> </span>
<span id="button-1122-btnIconEl" class="x-btn-icon icon-save-invoice"></span>
</button>
The number 1122 is dynamic and there are other buttons that has same beginning button-###+btnWrap
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…