Page 1 of 1

ComboBox Mania

Posted: Fri Nov 21, 2014 6:30 pm
by mcs
I'm sure that there's a simple solution for this but I'm not getting it.
I'm trying to get the list of values from a .NET ComboBox which is configured as a DropDownList (list only appears after box is clicked/pressed and cannot be written to).
Ranorex Spy appears to see the ComboBox and the list as two different entities and I have exhausted my knowledge on how to get this accomplished. I even built a new C# Windows Form app with just a ComboBox configured as a DropDownList on it to make sure that it was me and not the AUT which was the problem.
It is obvious that it is me so... any help and/or direction would be greatly appreciated.
Thanks!

Re: ComboBox Mania

Posted: Fri Nov 21, 2014 6:52 pm
by krstcs
It's not you...

.NET (like most other platforms/languages) actually creates a new pane for the list when you open a drop-down, and places it only when needed.

What you probably need to do is to spy out the objects (especially the list itself) with the "Ctrl-Left Win" combination.

1. Open spy.
2. Open your application.
3. Click the drop-down to open the list.
4. Move the mouse over the list and press the "Ctrl-Left Win" key combination.

This is how you spy/capture elements that are tricky like menus and drop-downs.

Re: ComboBox Mania

Posted: Fri Nov 21, 2014 7:38 pm
by mcs
Thanks, I've tried your suggestion krstcs and, during one of my many tries, I managed to see the list under the comboBox in spy but, as soon as the dropdown closes which is immediately, the list disappears from spy. Any trick that you know to keep it there? I think that once I have it in my repository, things will be easier...
Thanks.

Re: ComboBox Mania

Posted: Fri Nov 21, 2014 7:44 pm
by krstcs
Instead of using spy, try with a repository open. The same key-combination will add an item to the repo.

I forgot that spy did that.

Re: ComboBox Mania

Posted: Fri Nov 21, 2014 8:24 pm
by mcs
Aha! Thanks again; I didn't know that you could get items into the repository that way. :))