This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

testing SWING app with no user interaction

 
Ann Darseh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a small SWING application, it contains a few text fields and a
button. I want to test this without human interaction. For buttons, I tried the button.doClick() but it did not do anything! And for the text fields, I can't figure out how to do it. I am relatively new to SWING, I would appreciate your help so much.
Thanks,
Ann
 
Chris Brat
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
there is an automated tester as of 1.3,
java.awt.Robot
it allows screen capture, and automated mouse movement, clicking etc...
unfortunately i havent played around with it yet to give you more information.
if you try it out and like it please let me know.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are some unit testing frameworks already built for testing Swing GUIs -
jfcUnit and Abbot are both built as extensions to the JUnit unit testing framework to test GUI applications.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic