On Mar 12, 2007, at 9:48 AM, Charles Yeomans wrote: > > I think it's certainly possible, if you want to go to the trouble of > factoring your code to make it possible. Here's a simple dumb > example. Suppose you have a window containing a Pushbutton and an > EditField. Pushing the button is supposed to set the EditField's > text to "Foo". So add a method HandleAction(p as Pushbutton) to the > window, and implement it to do the work. > > Sub HandleAction( p as Pushbutton ) > EditField1.Text ="Foo" > End Sub > > Now you can write test code to simulate a Pushbutton click. > > Sub TestClickPushbutton() > HandleAction Pushbutton1 > End Sub > > > In the presence of more controls, it will of course become more > complicated. Instead of adding methods to the window, you might want > to use delegates that implement event handlers; then to simulate user > actions, you simply call the delegate methods in test code.
Systems Events already has a means for me to write an AppleScript that can push buttons, click, select menus, etc. So I really think I need to factor my code just to use an AppleScript and System Events to drive my UI. What I'm finding is that System Events can select menus, etc but cannot identify buttons in an RB app so they can be pushed clicked etc I'm really wondering if anyone has used the System Events scriptable application to drive an RB app and if they could offer any hints. _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
