tandrews
11 years agoOccasional Contributor
Wrong Button Clicked in Keyword Test
I have recorded a keyword test to click a confirm button on a form. However, when I run it, it clicks the deny button. The script behind the form is
<div class="right" id="requestButtons">
<div class="affirmativeButton left">
<input class="statusButton" type="image" src="/Content/images/btnConfirm.png" value="Pending Approval">
</div>
<div class="negativeButton left">
<input class="statusButton" type="image" src="/Content/images/btnDeny.png" value="Returned">
</div>
</div>
The id of these buttons is “request buttons”. But I am attempting to get the automated test to click the confirm status button (btnConfirm.png). But automated test keeps clicking deny status button (btnDeny.png). Although in each case I am telling it to click Confirm. Hopefully, this is a quick solution.
<div class="right" id="requestButtons">
<div class="affirmativeButton left">
<input class="statusButton" type="image" src="/Content/images/btnConfirm.png" value="Pending Approval">
</div>
<div class="negativeButton left">
<input class="statusButton" type="image" src="/Content/images/btnDeny.png" value="Returned">
</div>
</div>
The id of these buttons is “request buttons”. But I am attempting to get the automated test to click the confirm status button (btnConfirm.png). But automated test keeps clicking deny status button (btnDeny.png). Although in each case I am telling it to click Confirm. Hopefully, this is a quick solution.
- Note that the mapping only has "ImageButton" object type as a mapping criteria. If there is more than one object that will map that way, you may have issues like you've described.
If I were you, I'd edit that mapping to add additional criteria... something like Caption, Id, or something else that would uniquely identify the button to keep it distinctive of other similar objects.