Using WindowFinder to find a modal dialog

glenneroo

I am using FEST to test my Java dialogs and I need to test that a new modal dialog is 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 which extends JFrame for use in unit testing.

In my test, I click a button which makes a modal dialog appear. I am trying to find and verify the dialog is created, however all of my attempts aren't able to find anything:

WindowFinder.findDialog("Window Title")).using(robot);

Where robot =

  1. BasicRobot.robotWithCurrentAwtHierarchy();
  2. BasicRobot.robotWithNewAwtHierarchy();
  3. frameFixture.robot (frameFixture => JFrame)

I have also tried specifying the lookup scope of the robot:

robot.settings().componentLookupScope(ComponentLookupScope.ALL);

There are lots of FEST examples online which make a call to robot() but I can't find out how or what this robot function is supposed to be.

Why am I unable to find my newly created popup dialog?

Amber

Try adding a lookup time:

WindowFinder.findDialog(MyDialog.class).withTimeout(10000).using(robot);

For more info: http://fest.googlecode.com/svn-history/r458/trunk/fest/fest-swing/javadocs/org/fest/swing/fixture/util/WindowFinder.html

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Using Bootstrap Clockpicker in modal dialog

From Dev

Disposing a Modal dialog using a condition

From Dev

Modal Dialog Box using JQuery & AJAX

From Dev

How to show a modal dialog using bootstrap

From Dev

Show a modal dialog using primefaces commandLink in a growl

From Dev

Modal RCP Dialog not modal

From Dev

How to close the respective modal dialog when switch over to other modal dialog without overlapping - using Bootsrap 3

From Dev

Pop up reveal modal dialog when submit by using ajax

From Dev

ASP.net Button on click not firing using Jquery Modal Dialog

From Dev

How to make modal dialog with blur background using Twitter Bootstrap?

From Dev

Show progress bar in modal dialog using Twitter Bootstrap

From Dev

Keep me logged in php function using modal dialog login form

From Dev

Using CSS3 transition flip effects to show a modal dialog?

From Dev

How to scrape a Modal Dialog in Internet Explorer using PowerShell

From Dev

How to check if Windows Modal Dialog is present using Selenium WebDriver

From Dev

Image Preview in dialog modal not working when loading content using ajax

From Dev

How to edit ngxdatatable using modal dialog Angular 2

From Dev

href in modal dialog in bootstrap

From Dev

Passing parameters to modal dialog

From Dev

Validation in bootstrap modal dialog

From Java

Angular 2.0 and Modal Dialog

From Dev

Modal dialog to confirm delete

From Dev

Jquery Dialog modal issues

From Dev

Elm modal dialog box

From Dev

Displaying a Modal Dialog in AngularJS

From Dev

xpage Modal Dialog and sessionScopes

From Dev

Closing and resetting a modal dialog

From Dev

Pass value to dialog modal

From Dev

Editing a modal (dialog) submission

Related Related

HotTag

Archive