However, if your program was not already written with unit tests, then you are on a fools' mission. You are the good money thrown after bad. The authors of that program should have been writing it with unit tests, the way Charlie and others like him have been telling programmers to do for the past decade.
And notice I'm talking about tests that run from inside the program, calling its methods and objects directly, with nothing between the tests and code to add noise. If you had such tests, then writing tests that reach out to GUI objects and treat them as objects would be very easy.