1. A system for testing an application running on a target device, the system comprising: a target device storing and executing a software test agent, wherein said application under test is also stored and executed on said target device; a test development computer storing and executing a software test tool for testing and validating said application's rendering of output to a Graphical User Interface (GUI), said test tool configured to communicate with said agent on said target device; said software test tool executing a test script for testing and validating one or more aspects of said application's rendering of output to said GUI, said test tool operable to generate requests to said agent to obtain information from and send events to controls associated with said GUI; and said software test tool comprising a trap manager for handling trap events that can occur on said target device during execution of said test script, said trap manager executed by said test development computer to: allow a user to define a trap event and create an associated user-defined function for handling the trap event; automatically check whether the trap event has occurred during execution of said test script; and upon detecting an occurrence of the trap event, execute said user-defined function to handle said trap event.