posted 06-26-2002 12:48 AM
Link to example code: 17167244.zipI use Notepad as the application I test against. It's a simple program but has many of the objects you need to test, static text textbox, drop down lists, checkbox, radiobutton, command buttons, menuitems, etc.
Once you understand how to do it in a simple program you can add VB, ActiveX, Web, etc. to the mix.
Writing good code takes knowing how the test tool works and how to overcome it's quirks.
See Example Code...
Context sensitive errors can be overcome with good coding...
Oh I almost forgot:
These don't do the same thing even though it might sound like it in the on-line help!
"win_activate" and "set_Window" do similare things but are different!
"win_activate" makes the specified window the active window by bringing it into focus and raising it to the top of the display (equivalent to clicking on the window banner). All subsequent input is submitted to this window, keystrokes go to the Window not and object.
"set_window" secifies the window to receive subsequent input (TSL functions). You might still need to "win_activate" to send keystrokes to a Window or get some TSL functions to work properly.
Always use set_window before performing TSL functions on an object in a Window.
Always use win_activate before sending keystrokes (analog mode) to a Window.
Always "set_window" before "win_activate".
Even though the recorder does it the other way. A win_activate will NOT wait for the window to exist.
[This message has been edited by cranem451 (edited 07-20-2002).]