SilkTest no longer recognizes WPF controls, after the application under test was updated to use a newer version of the .Net Framework,
If you encounter this issue after upgrading a WPF application; the recognitions problem may relate to the lack of .Net native images on the affected machine. This can happen after upgrading the application under test, installing a new version of the .Net Framework; or after applying a Windows Update on the system.
Creating the .Net native images is quite an intensive CPU operation, as explained in the following wiki article:
How to confirm if you are affected by this problem:
The following screenshot shows the WPF sample application running without native images. Note that the PresentationFramework.ni.dll is not loaded into the AUT process, only the PresentationFramework.dll is present. In this scenario SilkTest's WPF support does not work.
The following screenshot shows the WPF sample application running with the PresentationFramework.ni.dll loaded into its process; in this case SilkTest's WPF support should work fine:
How to create the native images on Windows
1. Locate ngen.exe. On my Windows 7 use the .NET framework folder with the highest version number. eg:
> C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe
2. Launch a command prompt(under Admin Rights) and navigate into the directory above.
3. Run the “ngen.exe update” command.
* Note that ngen.exe may show some errors in the output, but these can be safely ignored.
4. Reboot the machine: Note that it can take some time for the system to apply the native images; so WPF recognition may not be recovered immediately. If this is the case shut down the application and wait for one hour, before trying it again. As soon as the native images are updated and loaded, SilkTest' WPF support should work correctly.