I'm trying to automate a very short sequence in a web application developped using ICEFaces. I need to click on a button which is coded as
<input type="image" title="Unterbrechen" style="padding: 3px;"
src="../resources/images/icons/pause_square_red_24.png"
onfocus="setFocus(this.id);" onclick="iceSubmit(form,this,event);return false;"
onblur="setFocus('');" name="formGOC:j_id52:0:j_id5330"
id="formGOC:j_id52:0:j_id5330" class="iceCmdBtn">
But on the next call, the same button is coded as follows:
<input type="image" title="Unterbrechen" style="padding: 3px;"
src="../resources/images/icons/pause_square_red_24.png"
onfocus="setFocus(this.id);" onclick="iceSubmit(form,this,event);return false;"
onblur="setFocus('');" name="formGOC:j_id52:0:j_id6813"
id="formGOC:j_id52:0:j_id6813" class="iceCmdBtn">
The name and id have changed:
id="formGOC:j_id52:0:j_id5330"
to
id="formGOC:j_id52:0:j_id6813"
Of course, all the ancestor elements change their names and ids in the same pattern too.
How can I reliably identify this button and define a locator for this element in selenium?
Thanks for your help!