填写一些文本字段后,我需要单击保存按钮。问题是每次我重新加载页面时xpath都会不断变化,id是动态的。请帮助我在 WebDriver 中单击此按钮。是否可以使用按钮的文本单击?这是萤火虫的输出。
请帮助如何生成目标以单击此按钮。
</div>
<div class="x-window-bl">
<div class="x-window-br">
<div class="x-window-bc">
<div id="ext-gen427" class="x-window-footer">
<div class="x-panel-btns-ct" id="ext-gen503">
<div id="ext-gen496" class="x-panel-btns x-panel-btns-right">
<table cellspacing="0">
<tbody>
<tr>
<td id="ext-gen430" class="x-panel-btn-td dms_bluebtn dms_smallbtn">
<table id="ext-comp-1039" class="x-btn-wrap x-btn " cellspacing="0" cellpadding="0" border="0" style="width: 75px;">
<tbody>
<tr>
<td class="x-btn-left" id="ext-gen537">
<i> </i>
</td>
<td id="ext-gen498" class="x-btn-center">
<em unselectable="on">
<button id="ext-gen432" class="x-btn-text" type="button">Save</button>
</em>
</td>
<td class="x-btn-right">
</tr>
</tbody>
</table>
</td>
<td id="ext-gen438" class="x-panel-btn-td dms_greybtn dms_smallbtn">
<table id="ext-comp-1040" class="x-btn-wrap x-btn " cellspacing="0" cellpadding="0" border="0" style="width: 75px;">
<tbody>
<tr>
<td class="x-btn-left">
<i id="ext-gen562"> </i>
</td>
<td id="ext-gen513" class="x-btn-center">
<em unselectable="on">
<button id="ext-gen440" class="x-btn-text" type="button">Cancel</button>
</em>
</td>
<td class="x-btn-right" id="ext-gen548">
<i> </i>