Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is there a tool to configure in a way that it locates buttons, clicks them, detects windows, reads text labels, determines if UI elements are checked/selected etc for Java? The tool need not be cross-platform.

share|improve this question
The GOOS book used WindowLicker – Gishu Mar 29 '11 at 14:19

3 Answers

A couple to take a look at:

share|improve this answer

This type of testing tends to be rather fragile. But yes there are frameworks out there that do this. Check out:

If you Google around, you'll find more alternatives. As to making your tests much more robust, always give the controls you want to test a unique ID. The tools should be able to recursively search the JPanel or dialog/window for the control with the named ID. That way you can move the control anywhere you want and not break the test. Change the ID or remove the control and of course you break things.

share|improve this answer

I've had luck writing very simple bare-bones classes that are stuck in between the GUI code and the real program logic, and using standard unit testing tools drive the program that way.

Yeah, if you change some buttons around or something you have to change that wrapper class as well, but that's far less obnoxious that editing some screen-scraping unit test.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.