Ask a Question

How to resolve recognition hint for when a button is clicked in a JDialog


How to resolve recognition hint for when a button is clicked in a JDialog



I am trying to automate an action for clicking a button within one dialog which causes another dialog to open. However, when I run the test, I keep getting an 'object recognition hint' warning because the playback cannot find the target button after the button is clicked.


Please help.


Thank you,



Champion Level 3

A screenshot of the two dialogs and of the test code involved would be helpful.



Esteemed Contributor

Basically, here's what's happening... your NameMapping for the dialog box is not specific enough... it found a dialog with the JavaClassName of JSDialog... but you have probably multiple objects mapped that way in your NameMapping with nothing clear to distinguish between the two.  What you need to do is go back to your NameMapping and add additional properties to your mapped objects so that they are uniquely identified.

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

Which is why I was asking for the screenshots  @tristaanogre   🙂

I have done that. What seems to be the issue is that on playback, TestComplete checks for the 'Discard Changes' button after the ClickButton action is already executed.



I'm unable to add anything more specific because these are both JOptionPane dialogs. I have tried adding more criteria to the NameMapping, but it doesn't change the results.





OK. I resolved the issue by removing JavaClassName ('JDialog') as an identifier. This prevents TestComplete from confusing the two JDialogs.


Thank you for your assistance. 🙂

Showing results for 
Search instead for 
Did you mean: