Get WPF DataContext via Ranorex API

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Posts: 1
Joined: Tue Dec 21, 2021 1:33 pm

Get WPF DataContext via Ranorex API

Post by moerwald » Tue Dec 21, 2021 1:37 pm


unfortunately I've a complex WPF GUI to test. Actually some data I want to validate is only avaiable as bound DataContext in WPF. Is it possible to retrieve the WPF DataContext of a WPF control via the Ranorex API?


Certified Professional
Certified Professional
Posts: 120
Joined: Mon Mar 22, 2021 10:01 pm

Re: Get WPF DataContext via Ranorex API

Post by Jacob » Tue Dec 21, 2021 10:52 pm

Hi moerwald!

Welcome to the forums! This may be possible depending on how the application is configured. One thing that may help would be to go into the Plugin Settings (Settings -> Plugins Tab -> WPF) and set the "Show All Elements" option to "True." Barring that, it may still be possible to pull that information using the GDI+ Capture functionality.