CR (capture and replay) has been a widely accepted methodology for GUI testing. However, a deficiency of a CR-based approach is that test scripts can not be produced before an application under test (AUT) is correctly implemented, which excludes the possibility of doing test-driven development (TDD). An alternative is the specification- based approach, which defines GUI behaviors by using a GUI specification language. A specification-based approach is suitable for doing TDD. However, after the AUT is partially or fully implemented, the specification-based approach becomes less convenient than the CR-based approach, since capturing can be very useful in maintaining test scripts. In this paper, we propose the integration of the specification-based and CR- based approaches so as to incorporate both of their advantages. We define an event model which servers as the core of both the specification language and the capture/ replay mechanism. Based on this event model, we implement a GUI testing tool, called GTT, for Java applications. We show how to apply GTT in a TDD style for GUI testing and quantitatively report the benefits of the integration.