In my application I uses a menuItem call to show a JOptionPane with the default OK, Cancel Button. How can I find the components buttons (Ok, Cancel) in order to click them?
I always used the NamedComponentFinder but in this case I can' t assign a name to the buttons.
Thanks
Marco
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In my application I uses a menuItem call to show a JOptionPane with the default OK, Cancel Button. How can I find the components buttons (Ok, Cancel) in order to click them?
I always used the NamedComponentFinder but in this case I can' t assign a name to the buttons.
Thanks
Marco
When I have a confirm dialog with a "Delete" title, I use something like this:
Finder finder = new DialogFinder("Delete", true);
JDialog dialog = (JDialog) finder.find(inParent, 0);
Finder finder = new AbstractButtonFinder("OK", true);
AbstractButton confirmButton = (AbstractButton) finder.find(inContainer, 0);
Not internationalizable like when using the name attribute, though.
--Etienne