mcolwellrpi Posted March 20, 2006 Posted March 20, 2006 I must repeat the same repetative task in a windows gui hundreds of times at work. I have looked into automating this with auto it but it seems unreliable. it will get it right only about half the time. One of the problems is that for many actions like making menu selection the only way I can get it to work is by sending keys. For instance sending '!t' for tools 'o' for options then send more keys to change options this seems less relieable than sending commands and clicks to contols. I also have no way to confirm that these actions were successful. Does any one know how to send commands like 'select' or 'click' directly to gui entities like 'folder tree viewers', 'tabed panes', 'toolbar buttons', 'menubars and menu items'. Also how can I confirm that an option was actually changed or that an item was actually selected from these things. another problem is that it seems that the script can predictably pause for no apparent reason at certain times in the script rather than continue? I am generally using this code to do stuff and make sure it was actually done. If NOT WinWaitActive("some window","",3) Then processError() return EndIf WinActivate("some window") ControlFocus("some window","","some button text") ControlClick("some window","","some button text") The problem is that some times instead of either recognizing "some window" as active and sending a command or recognizing it's not and giving an error it will do absolutely nothing??? Also this is my first atempt at windows gui scripting. I haven't looked into any other possible tools. If this isn't the kind of thing autoit was designed for can any one guide me in the right direction. Are there any open source Automated gui testing suites? Will VB and VB script do what I'm looking for?
Valuater Posted March 20, 2006 Posted March 20, 2006 (edited) 1Welcome to the forums2Autoit is VERY reliable... it only depends on the script. It must cover all cercumstances that may occur3to help correct your scriptWinActivate("some window") WinWaitActive("some window","",3) If NOT WinActive("some window") Then processError() return EndIf ControlFocus("some window","","some button text") ControlClick("some window","","some button text")****not tested ****4be sure to use the AU3Info.exe to get the command/control ID's5there is a great example of using the controls herehttp://www.autoitscript.com/forum/index.php?showtopic=21048#8) Edited March 20, 2006 by Valuater
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now