Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sradenling opened this issue Apr 12, 2024 · 0 comments
Open

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

sradenling opened this issue Apr 12, 2024 · 0 comments

Comments

@sradenling
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant