Closed peterpilgrim closed 9 years ago
Sorry I found the answer I was looking for.
The answer is the execute the setRoot(Component)
@Test
public void open_dialog_then_click_confirm()
{
swinger.clickOn("text:Open Dialog ...").pause(1000).setRoot(dialog);
swinger.clickOn("name:dialogConfirmBtn").pause(250);
assertThat(dialog, is(notNullValue()));
}
PS: You might want to add a similar name method to setRoot()
like Swinger Swinger.setComponentRoot(Component)
that can return this
in order to keep the fluent design.
Hi, glad you found a solution. Usually you should create a new Swinger
for each frame you have like this:
Swinger swinger = Swinger.getUserWith(dialog);
So you don't need to set root
(but you can if you prefer).
Hi Renato
I found a reference to your framework through the JavaFX developers list.
Give this sample code that opens a Swing JFrame followed by a custom JDialog compenent, how can you find the dialog component with Automaton?
The error I see is the following:
Does your framework support modal dialogs? Is there a missing method that searches for the dialog by component name that I need to apply here in the test? Do you have any suggestions?
Thanks in advance