I'm trying to select a Gui testing framework tool for a swing based application. I started to have a look on FEST and created a Demo program to check how fast the run time is.
My demo program (code bellow) took about 85000 millisec to complete which appeared very slow to me.
So my question is this the normal speed of Fest ?
public class DemoGui extends JFrame
{
private JPanel contentPane;
private JTextField textField;
private JPanel panel;
private JButton btnNewButton;
private JButton btnRun;
public static final int REPEAT = 10;
public static void runX(final JFrame window)
{
final FrameFixture main = new FrameFixture(window);
new Thread(new Runnable()
{
@Override
public void run()
{
final long start = System.currentTimeMillis();
for (int i = 0; i < REPEAT; i++)
{
main.textBox().deleteText().setText("this is a test demo");
main.button(JButtonMatcher.withText("OK")).click();
}
final long end = System.currentTimeMillis();
System.out.println("Exec Time : " + String.valueOf(end - start));
}
}).start();
}
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
try
{
DemoGui frame = new DemoGui();
frame.setVisible(true);
}
catch (Exception e)
{
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public DemoGui()
{
setTitle("DemoGui");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
textField = new JTextField();
contentPane.add(textField, BorderLayout.NORTH);
textField.setColumns(10);
panel = new JPanel();
contentPane.add(panel, BorderLayout.SOUTH);
btnRun = new JButton("run");
btnRun.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
runX(DemoGui.this);
}
});
panel.add(btnRun);
btnNewButton = new JButton("OK");
panel.add(btnNewButton);
}
}
Aucun commentaire:
Enregistrer un commentaire