Sign in to follow this  
Followers 0
mcolwellrpi

Reliability In Automating Other Gui S

2 posts in this topic

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

1

Welcome to the forums

2

Autoit is VERY reliable... it only depends on the script. It must cover all cercumstances that may occur

3

to help correct your script

WinActivate("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 ****

4

be sure to use the AU3Info.exe to get the command/control ID's

5

there is a great example of using the controls here

http://www.autoitscript.com/forum/index.php?showtopic=21048#

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0