简体   繁体   中英

Selenium for WPF UI automation testing

我可以使用Selenium进行WPF UI自动化测试吗?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM