Cannot do actions on the secondary window with FEST/swing

51 Views Asked by At

public class DemoTest {

private FrameFixture demo;

@Before
public void setUp() {

    demo = new FrameFixture(new Demo());
}

@After
public void tearDown() {

    demo.cleanUp();
}

@Test
public void test() {


    demo.button("myButtonFromTheMainFrame").click(); //on the main frame is happening
    demo.button("myButtonFromTheSecondFrame").click();//here it is not happening
}

}

I have a minimum SWING Frame configuration which contains a button that when it gets clicked it opens a new frame (the main frame is still on). This secondary frame has another button but I cannot do any automated tests anymore on the second frame. I tried with this solution:

Robot robot = BasicRobot.robotWithCurrentAwtHierarchy();

FrameFixture frame = WindowFinder.findFrame("Title of my frame").using(robot);

but any action that I am doing on the secondary frame is not happening...so the button is not getting clicked on the 2nd one, only on the first

I haven't found any solution on this issue when a new window gets opened and start doing automated tests on it. Can somebody give me some advices? What am I doing wrong?

0

There are 0 best solutions below