assertj-swing icon indicating copy to clipboard operation
assertj-swing copied to clipboard

ClassCastException on JOptionPaneFixture.title()

Open xcruel opened this issue 6 years ago • 1 comments

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();

xcruel avatar Sep 03 '18 09:09 xcruel

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..

croesch avatar Oct 01 '18 11:10 croesch