WinAppDriver Vs. Coded UI is a pointless question to ask. Just use WinAppDriver if you're starting UI test automation of your Windows application from scratch. Yes, there will be support for Coded UI for a while, but ultimately it will be phased out.
The differences between WinAppDriver and Coded UI are given here.
You read it right, Microsoft's flagship test automation tool, the CodedUI is dead. Microsoft has started to announce it that it is deprecating Coded UI publicly as well. The C# and VB.Net Coded UI project types are now showing deprecated written right next to them. Various MSDN help articles state clearly that Coded UI won't be supported after Visual Studio 2019.
This is it, the end of road for Coded UI, see the image below :'(
Proof that Microsoft Coded UI is deprecated
I came to notice this fact when I installed Visual Studio 2019 RC on my Windows 10 PC, in Feb/March 2019.
I've been using(or wresting with) Coded UI for a quite a few years now. I naturally thought what will be the next solution for UI test automation of Windows applications.
The Future of Windows Test Automation
The answer was right there alongside the death announcement of Coded UI. The new way to go is according to Microsoft, their free & open source WinAppDriver combined with Appium WebDriver.
Windows Application Driver a.k.a WinAppDriver is going to be need Windows 10 to run tests. That too in developer mode. Automated functional testing of legacy Win32 applications will be possible on Windows 10. This includes testing WPF, WinForms, and UWP applications using WinAppDriver.
You'll need to install Node.js and WinAppDriver for this purpose. Microsoft .Net framework is needed to make it work.
You also must have developer mode enabled in Windows 10 to run WinAppDriver.
I will be publishing more tutorials about this topic in the future. Subscribe to my channel and stay tuned.
The WinAppDriver can be downloaded from the Git repository here.
A UI recorder is also available for helping you in identifying control properties.
Your scripts are going to communicate with the WinAppDriver using http. The UI automation code might be written in C# .Net or many other languages available.
The UI or test automation code can be placed on the same machine as the driver, or on a different machine.
Just in case you want to learn what is Windows Application Driver or WinAppDriver for short all about. I am working to prepare an online Udemy course for the subject. I'm using C# .Net and Visual Studio community edition for the instructions shown in this course. Don't worry, Microsoft is killing a closed source proprietary tool which was pretty evil anyway. The WinAppDriver is free & open source. Entire code base is available for you to see on GitHub. In fact it is a pretty active repository.
The UI recorder that comes bundled with WinAppDriver is also pretty neat for finding controls and generating XPath for location them.