Is there a way to blur Swing apps?

In the old days, PalmOS had an emulator that could generate random events ("click here, enter the garbage in this text box ...") to test how applications will process them (the so-called "Gremlins"). This is a bit like fuzzing, but for a GUI. Is there a simple (existing) way to do this in a Java Swing application?

Edit:

Please note that I do not want to indicate which events will be fired. I would like some kind of code to automatically generate and run random ones (as in the "Math.random ()" events). The likelihood that the event is something useful or to find a mistake is quite small. But this is offset by the launch of many events.

+4
source share
1 answer

Try FEST . This simplifies the functional testing process of the Swing GUI by allowing you to access the Swing components by name and then interact with them.

Example from the FEST website:

dialog.comboBox("domain").select("Users"); dialog.textBox("username").enterText("alex.ruiz"); dialog.button("ok").click(); dialog.optionPane().requireErrorMessage() .requireMessage("Please enter your password"); 

Edit:

Alternatively, what you are trying to achieve should be very simple using Math.random (), a loop, findBomponentAt (int, int) and the Robot class. The Robot class mitght class is especially useful because it has methods for replacing mouse and keyboard events.

+5
source

Source: https://habr.com/ru/post/1415802/


All Articles