Windows Forms Recognition Problem.
Why does SilkTest fail to recognize the .Net controls running within a Windows Forms application? When recording actions or Locators; the objects are all tagged with the generic 'Control' class, rather than the native class of the control:
One possible reason why recognition of .Net controls might fail is if the application runs on CLR 1.1; because CLR 1.1 applications are considered Win32 rather than Window Forms.
Typically a target .Net Framework would be specified within the Visual Studio project. However if no target framework is defined; the application may run on the lowest version framework available on the system.
If this is CLR 1.1 the application will be recognized as Win32 domain; however if CLR 2.2 or later is the lowest framework version on the machine, then Windows Forms recognition should work correctly.
You can confirm which version of the .Net framework an application is running on, by examining its process using a tool such as Process Explorer. This will expose all Dlls loaded into the process; some of which will be related to the .Net framework version, as shown in the following screenshot:
To resolve this issue you could request that the developers specify a target .Net framework in the project, and provide a new build of the application containing these configuration changes. However if you have no access to the developers; you can also force the application to use CLR 2.2 by creating a file.exe.config file with the following content:
<?xml version="1.0" encoding="UTF-8"?>
Note that the name of this file needs to match the name of the executable. For example if your executable was named 'sample.exe' you would save the file as 'sample.exe.config' in the same directory as the executable.
After restarting the Open Agent the application and its child controls should now be recognized by their native classes: