2
我想寫一個巨星搖擺測試,但我有麻煩製造/尋找框架夾具。我有兩個JFrames,一個打開其他的點擊,我想要麼:FEST搖擺新的框架點擊,不能使新的框架夾具
1)發現新JFrame的框架夾具打開
2)使新幀燈具出(我可以從原來的JFrame對象的對象。)
我曾嘗試創建新的JFrame對象使用
GenericTypeMatcher<secondGUI> matcher = new GenericTypeMatcher<secondGUI>(secondGUI.class) {
protected boolean isMatching(secondGUI frame) {
System.out.println("0".equals(frame.getTitle()) && frame.isShowing());
return "0".equals(frame.getTitle()) && frame.isShowing();
}
};
Robot robot = BasicRobot.robotWithCurrentAwtHierarchy();
尋找幀,但碰上EdtViolationException。
我也曾嘗試
secondGUI secGUI = GuiActionRunner.execute(new GuiQuery<secondGUI>() {
@Override
protected secondGUI executeInEDT() throws Throwable {
return firstGUI.getController().getWindows().get("0");
}
});
FrameFixture secondWindow = new FrameFixture(secGUI);
但最後一行給了一個EdtViolationException爲好。 有什麼建議嗎? 謝謝!