Skip to content

Top-level JFrame can be selected, top-level JDialog cannot #116

@sradenling

Description

@sradenling

I'm trying to understand why Robot Framework can't seem to connect when using a JDialog as the top level window but it works perfectly when using a JFrame.

The test:

*** Settings ***
Library  RemoteSwingLibrary  debug=True

*** Test Cases ***
My Test Case
    Start Application  DialogTest  java -cp /projects/rdialog DialogTest
    Select Dialog  Main
    Push Button  Close

A minimal dialog example:

import javax.swing.*;

public class DialogTest {
    public static void main(String[] args) {
        JButton button = new JButton("Close");
        JDialog dialog = new JDialog();
        dialog.setTitle("Main");
        dialog.add(button);
        dialog.setBounds(50, 50, 200, 100);
        button.addActionListener(e -> {
            dialog.dispose();
        });
        dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        dialog.setVisible(true);
    }
}

When attempting to run the test it fails with RemoteSwingLibraryTimeoutError: Agent port not received before timeout.
Running the test with Select Window instead of Select Dialog and replacing JDialog with JFrame in the source works. What am I missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions