Reputation: 113
I am trying to find a way to interact with a GUI using java, i want to write a script to open an application, enter username and password and click "login" and such things. is there any way to do it?
Upvotes: 0
Views: 314
Reputation: 1248
Maybe you are searching something like Java robot it is similar as Selenium but for system applications. I used this to perform UI-Tests in the past http://alvinalexander.com/java/java-robot-class-example-mouse-keystroke
And to launch one System command from java you can use
Runtime.getRuntime().exec("System specific command line text here");
As well as
File file = new File("/absolute/path/to/yourExecutable");
Desktop.getDesktop().open(file);
Upvotes: 2