cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong Button Clicked in Keyword Test

SOLVED
Highlighted
Occasional 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.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

RE: Wrong Button Clicked in Keyword Test

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.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

6 REPLIES 6
Highlighted
Community Hero

RE: Wrong Button Clicked in Keyword Test

Without knowing exactly what your Keyword test looks like, hard to say.



However, best guess?



Most likely your NameMapping or aliasing of your button is ambiguous so it is simply clicking on the first button it comes.  Check your mapping criteria for your button being clicked and see if you need to make some changes in its identifiers.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

RE: Wrong Button Clicked in Keyword Test

Here is the section of the Keyword test info.



cellRequestId Click ... Clicks at point (47, 17) of the 'cellRequestId' object.

Set Variable Value ReqNo [Project] Aliases.browser.pageMymome.panelRequesttabs.panelTblactiverequestsWrapper.tableTblactiverequests.cellSorting1.Click 

imagebutton3 Click ... Clicks at point (77, 20) of the 'imagebutton3' object.

button2 ClickButton  Clicks the 'button2' control.

textnodeClose Click ... Clicks at point (2, 14) of the 'textnodeClose' object.

panelBlockuiBlockoverlay HoverMouse 1514, 126 Moves the mouse pointer over the 'panelBlockuiBlockoverlay' control.



It clicks imagebutton3 however this clicks an incorrect button.
Highlighted
Community Hero

RE: Wrong Button Clicked in Keyword Test

What is the mapping of that imagebutton3?

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

RE: Wrong Button Clicked in Keyword Test

Aliases.browser.pageMymome.panelUiDialogUiWidgetUiWidgetCon.imagebutton3



In the name editor nothing is listed
Highlighted
Community Hero

RE: Wrong Button Clicked in Keyword Test

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.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Occasional Contributor

RE: Wrong Button Clicked in Keyword Test

Editing the mapping and addiing additional info worked!
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors