Get all frames
Get each frame's owned windows with getOwnedWindows()
public void testPresentMovieDialog() {
JMenuItem presentMovie = findJMenuItem(menubar, "Present Movie");
presentMovie.doClick();
Frame[] allFrames = Frame.getFrames();
for (int i = 0; i < allFrames.length; i++) {
Window[] owned = allFrames[i].getOwnedWindows();
for (int j = 0; j < allFrames.length; j++) {
Dialog dialog = (Dialog) owned[j];
if ("Present Movie".equals(dialog.getTitle())) {
return;
}
}
}
fail("No present dialog");
}