Can I use Selenium to do WPF UI automation testing?
Using Selenium for testing the UI of your apps When there is a need for automated UI tests, developers tend to use Selenium as it is a great way for automating common interactions a user would perform through a browser over web applications.
The simple answer is no. Selenium testing is designed to automate web applications, not desktop applications. Automating desktop applications requires a different type of automation tool that's designed for desktop automation.
We can use Selenium for . NET applications.
Support for WPF automation exists in WPF itself. Check out AutomationPeer. This article might help. This article is more detailed. All this is good if you want to automate interaction with the UI itself (the usefulness of which is debatable).
Another course of action is to unit test the business logic without touching the UI - if the application uses MVVM then the loose coupling between View and ViewModel should make unit testing a breeze. I get the impression that you're more into automating the UI though.
Yes, you can use Appium which is based on Selenium.
There is a pretty good introductory blog post by Scott Hanselman: WinAppDriver - Test any app with Appium's Selenium-like tests on Windows.
You'll need the WinAppDriver that "supports testing Universal Windows Platform (UWP) and Classic Windows (Win32) apps on Windows 10 PCs".
Selenium can be used to automate only web applications. If your WPF is an windows application you can not automate it.
If you WPF application runs in a web browser using XBAP, still you will not be able to automate the application. So the answer is NO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With