Jump to content
Sign in to follow this  
atimmerman

AutoItX, TreeView32 and VB.Net

Recommended Posts

atimmerman

I am trying to automate the setup process for the product that I test using AutoItX with a VB.NET program. On the whole I am having great success with the program and am quite impressed with AutoIt.

The setup is an InstallShield setup program and one of the screens in the setup is a TreeView32 control. The AutoIt Window Info tool identifies the control as a SysTreeView32. The control has some elements that are expandable and all the elements have checkboxes in front of them.

The problem that I am having is that I cannot check or uncheck any of the elements using the ControlTreeView method. All the the other commands for the method works on the control. I can select elements, tell if they exist, expand and collaspe the tree elements, get the count, tell if they are checked or unchecked, and get the text of a selected element. The only thing that I cannot do is check or uncheck the selected element. The fact that the ControlTreeView method can tell if a given element is checked or unchecked tells me that AutoItX knows that the checkbox is there.

I have also tried sending a {SPACE} using the Send command to the element after I have selected it (to simulate hitting the spacebar), but that does not work either. You can see that the application sees the space because there is a brief flicker when the space is sent.

So:

1. Am I doing something wrong to check the element? I use the code:

oAutoItX.ControlTreeView(szCaption,szText,szControlID,"Check",szElemt, "")

where:

oAutoItX is the name of the object that I created for AutoItX

szCaption is the caption of the dialog that the tree control is in

szText is additional text that is in a static field the the dialog

szControlID is the name of the tree control

szElement is the name of the element that I want to check

2. IS there a trick to simulating a spacebar hit for a control. I was using the Send function with the string "{SPACE}"

Thanks for the help

Share this post


Link to post
Share on other sites
daluu

Well, AutoIt's GUI automation library is nice but pales in terms of full control of Windows GUI control's, even ones that appear to be standard Windows controls, when compared to commercial GUI test tools. So I can believe the possibility of some methods not actually working as you'd hope, from my experience.

Other tricks you could try are send spacebar twice (sometimes the automation happens too fast to register it on the app under test), or perhaps use mouse clicks (set to relative coordinate mode), with coordinates relative to the treeview control.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.