Vin
Vin

Reputation: 111

Selenium for WPF UI automation testing

Can I use Selenium to do WPF UI automation testing?

Upvotes: 11

Views: 19010

Answers (3)

Grzegorz Smulko
Grzegorz Smulko

Reputation: 2803

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".

Upvotes: 7

Gigi
Gigi

Reputation: 29421

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.

Upvotes: 9

Purus
Purus

Reputation: 5799

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.

Upvotes: -1

Related Questions