assertj-swing
assertj-swing copied to clipboard
ClassCastException on JOptionPaneFixture.title()
Hi!
I get ClassCastException
when calling JOptionPaneFixture.title()
.
My code:
final JOptionPaneFixture optionPane = JOptionPaneFinder.findOptionPane().withTimeout(3000).using(robot);
final String title = optionPane.title();
Error i get:
java.lang.ClassCastException: javax.swing.JInternalFrame cannot be cast to java.awt.Dialog
Im using java 8 javax.swing.JOptionPane
in my gui.
Ofc it works if i cast it to JInternalFrame
.
final String title = ((JInternalFrame) optionPane.target().getRootPane().getParent()).getTitle();
Thanks for opening this issue - could you please provide an example code to reproduce the behaviour? That would help much, thx.
We have the JOptionPaneDriver_requireTitleAsText_Test, it's supposed to run the code where you get an exception and it passes.
I assume the ClassCastException
occurs in JOptionPaneTitleQuery
, right?
I'm marking this as invalid, until a reproducable test is attached..