I use FEST to test my Java dialogs, and I need to verify that a new modal dialog is being created.
@Before public void setUp() throws Exception { TestFrame testFrame = GuiActionRunner.execute(new GuiQuery<TestFrame>() { @Override protected TestFrame executeInEDT() throws Throwable { panel = new CustomPanel(); return new TestFrame(panel); } }); frameFixture = new FrameFixture(testFrame); frameFixture.show(); frameFixture.robot.waitForIdle(); }
Note. TestFrame is a helper class that extends the JFrame for use in unit testing.
In my test, I press a button that creates a modal dialog. I try to find and verify that the dialog is created, however, all my attempts cannot find anything:
WindowFinder.findDialog("Window Title")).using(robot);
Where is the robot =
- BasicRobot.robotWithCurrentAwtHierarchy ();
- BasicRobot.robotWithNewAwtHierarchy ();
- frameFixture.robot (frameFixture => JFrame)
I also tried to specify the robot search area:
robot.settings().componentLookupScope(ComponentLookupScope.ALL);
There are many FEST examples on the Internet that call the robot() call, but I cannot find out how and what this robot function should do.
Why can't I find my new popup dialog?
source share