Using White to read contents of hidden VB6 ListBox

167 views
Skip to first unread message

Kathy Judd

unread,
Apr 30, 2015, 4:11:41 PM4/30/15
to teststa...@googlegroups.com
Hello,

This is a report because my original did save the body. I'm trying to read the contents from an old VB6 app using White. There is a hidden ListBox on the form that White isn't able to see. Using Spy++ the ListBox shows up as ThunderRT6ListBox. I've used Visual UI Automation Verify and it's not able to see the control also.

Here is the code that I'm using. So far I'm able to get pointer to the form and other controls but not the ListBox. Is there a way to get the control using White. I would prefer not to use User32.dll if I don't have to.

I appreciate the guidance.


         TestStack.White.UIItems.WindowItems.Window searchform = ultima.ModalWindows().FirstOrDefault( mw => mw.Name == "Scan List for Index Searching" );
    // Try to get Listbox directly
    var test = searchform.Get( TestStack.White.UIItems.Finders.SearchCriteria.ByClassName( "ThunderRT6ListBox" ) );
    
    // Loop through all the controls
    foreach ( var item in searchform.Items )
    {
           Console.WriteLine( item.ToString() );
    }





Jakob Øjvind Nielsen

unread,
May 5, 2015, 3:33:35 PM5/5/15
to teststa...@googlegroups.com
Hi Kate
When your Spy++ tells you that its a ThunderRT6ListBox, you can't be sure that the control has implemented a provider for UIAutomation or MSAA. I've lately been doing a lot of work automating VB6 applications with white and build providers for UIAutomation, and my experience is that there is only a few of these advanced VB6 control that supports automation. 
To a start you should try figure out which classname the using autoit, you might find that the ThunderRT6ListBox has a different classname. But if white hasn't any direct support for the control, then you need to develop a UIAutomation Provider to support it. That's a steep learning curve but doable :)

But start with posting the real classname for the control or if possible ask the developers of the vb6 application which control they have used and from which library they have taking it from.


Best regards
Jakob Øjvind Nielsen
Testware ApS
Reply all
Reply to author
Forward
0 new messages