I'm testing an application developed in C# using WinRunner 7.01 (VB add-in only).
First of all I've mapped the .NET classes to standard classes, and it worked (quite) fine untill I've found a problem recognizing check button.
That's the problem: after the mapping, GUI spy recognizes objects basing on their MSW_class, and check button belongs to the same class of push button (windowsforms10.button.app1, by the way).
The result is that I can't set the button state or get the "value" property from check buttons (i.e. "checked", "unchecked", etc.) because are not supported for the push_button class.
I've tried to add "value" to the list of learned properties, but GUI spy still ignores (not even display!) this property.
So I took a look at Outlook Express (the first "non .net" application I've found...) to see how manages check button...
At this point I've found that even in Outlook Express check button and push button belongs to the same MSW_class (Button), but they're treated differently: check button belongs to check_button standard class and push button to push_button standard class.
AFAIK is not possible mapping one class to two different classes, so where is the trick?
The trick is, that WinRunner uses the Window-Style (BS_AUTOCHECKBOX) to do the correct mapping. This style does NOT exist for .NET checkboxes, so they are treated as normal buttons.
There is a way to get .NET-Support into WinRunner (but its hard to implement):
1) You have to hook the API call of GetClassNameA ONLY for the crvw.exe module of WinRunner (search for APIHijack in google). Here you can manipulate the MSW_class windowsforms10.button.app1 into winforms_checkbutton or something else.
To determine, if it is a check_button, you have to use the MSAA-SDK (search Microsoft pages for MSAA-SDK) and use the function get_accRole (it returns ROLE_SYSTEM_CHECKBUTTON, ROLE_SYSTEM_RADIOBUTTON or ROLE_SYSTEM_PUSHBUTTON)
2) Map this manipulated class to check_button.
3) Create a custom record function for the custom class winforms_checkbutton. In this function use get_accState (MSAA-SDK) to get the state of the button.