O'Reilly logo

Swing Extreme Testing by Tim Lavers, Lindsay Peters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Showing, Finding, and Reading Swing Components

In the previous chapter, we implemented our first test of a Swing user interface, the LabWizard login screen. However, we glossed over several important points. For example, we did not provide a test that the Ok button of a login screen was enabled if and only if a user name and password had been entered. Also, we did not look at how we could check that a particular error or warning message was being shown.

In order to write such tests, we need a way of finding individual components, such as a particular button, or some label showing specific text. We also need techniques for reading the state of components, such as whether they are enabled, or what text they are showing.

The underlying difficulty ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required