1. In an object-oriented environment, a method of testing a software program comprising a plurality of components, the method comprising: determining a cursor position; ascertaining an accessibility context associated with the cursor position; identifying a component by reference to the accessibility context; searching a component hierarchy for an object having an accessibility context matching the component's accessibility context; and replaying an event by calling a program method defined by an accessibility role for the object.