Object recognition may be slow in WPF applications running on modern .NET, for example, .NET 6 or later. If Ranorex Spy takes a long time to track WPF elements or populate the element tree, configure the WPF.Core plugin to use the legacy serialization mechanism.
Verify the WPF plugin configuration
Before changing the serialization mechanism, verify that the required WPF plugins are configured:
- In Ranorex Studio, open Settings.
- Select Plugins.
- Locate the WPF and WPF.Core sections.
- Verify that the WPF plugin is being used and that the WPF.Core plugin is enabled.
Use the legacy serialization mechanism
To change the serialization mechanism:
- In Settings > Plugins, expand WPF.Core.
- Set Use a legacy serialization mechanism to True.
- Select OK.
- Restart the application under test (AUT).
- Track the affected elements or run the test again to determine whether recognition performance has improved.
If object recognition remains slow, collect WPF tracing logs and provide them to Ranorex Support for further investigation. For instructions, see Collect WPF Object Recognition Tracing Logs.
For general performance issues that are not limited to WPF applications, see Troubleshoot Slow Object Recognition.
For problems in which Ranorex cannot identify the required WPF elements or displays the wrong element representation, see Troubleshoot Object Recognition in .NET WPF Applications.