How can I create a main window (frame) for my Katalon script and keep it open?

75 Views Asked by At

I want to create and show a main frame (not a dialog) for my (Katalon Studio) script so to put some components in there. Like labels, buttons, checkboxes etc. As a first step I am trying to create and open an empty frame.

CustomFrame.showForm("Test Title")

public class CustomFrame {
    public static Object showForm(String title) {
        JFrame frame = new JFrame(title)
        frame.setAlwaysOnTop(true)
        frame.requestFocus()
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
        frame.pack()
        frame.setSize(500, 500)
        frame.setLocationRelativeTo(null);
        frame.setVisible(true)
    }
}

When I run the script I get the message from Katalon that passed, frame show up for a moment but doesn't stay open!!!

0

There are 0 best solutions below