<p>I am familiar with nunit for unit testing of the business layer however I am looking now to automate the test of the win forms gui layer.  </p>

<p>I have seen <a href="http://watin.sourceforge.net/" rel="noreferrer">watin</a> and the watin recorder for automating tests on web application by accessing the controls and automating them. However I am struggling to find a watin equivalent for windows forms (written in c# or vb.net) preferably that is open source.    </p>

<p>Does one exist or are all products based on recording mouse and keyboard presses?</p>

<p><strong>Update:</strong> I have looked at this <a href="http://blog.benhall.me.uk/2008/02/project-white-automated-ui-testing.html" rel="noreferrer">blog post on white</a> and it seems the sort of thing I am looking for. The blog post raises some issues but as white is only in version 0.6 these may be resolved. Be interested if others have used white or any others for comparison. </p>

[{'answer_id': 25344, 'author': 'Dale Ragan', 'author_id': 1117, 'author_profile': 'https://Stackoverflow.com/users/1117', 'pm_score': 3, 'selected': False, 'text': '<p><a href="http://www.automatedqa.com/products/testcomplete/index.asp" rel="noreferrer">AutomatedQA\'s TestComplete</a> is a good testing application to automate GUI testing.  It supports more than just Windows Forms also, so you can reuse it for other applications.  It is not open source and this is the best that I have found.  I haven\'t seen an open source equivalent to WatiN.  It does have a free trial, for you decide if you like it or not.  The main reason I went with it, is that it really is cost effective, compared to other testing applications.</p>\n'}, {'answer_id': 25346, 'author': 'denis phillips', 'author_id': 748, 'author_profile': 'https://Stackoverflow.com/users/748', 'pm_score': 6, 'selected': True, 'text': '<p>Check out <a href="http://www.codeplex.com/white" rel="noreferrer">http://www.codeplex.com/white</a> and <a href="http://nunitforms.sourceforge.net/" rel="noreferrer">http://nunitforms.sourceforge.net/</a>. We\'ve used the White project with success.</p>\n\n<p><em>Same Answer to a previous question</em></p>\n\n<p><strong>Edit</strong></p>\n\n<p>The White project has moved, and is now located on <a href="https://github.com/TestStack/White" rel="noreferrer">GitHub</a> as part of TestStack.</p>\n'}, {'answer_id': 201074, 'author': 'Sam Warwick', 'author_id': 3873, 'author_profile': 'https://Stackoverflow.com/users/3873', 'pm_score': 1, 'selected': False, 'text': '<p>You could check out the Microsoft <a href="http://msdn.microsoft.com/en-us/library/aa348551.aspx" rel="nofollow noreferrer" title="UI Automation">UI Automation</a> framework. This has been included in .NET since version 3.0. This is actually what the White framework uses anyway.</p>\n'}, {'answer_id': 393541, 'author': 'Bruce McLeod', 'author_id': 49156, 'author_profile': 'https://Stackoverflow.com/users/49156', 'pm_score': 2, 'selected': False, 'text': '<p>As far as I know, <a href="http://www.codeplex.com/white" rel="nofollow noreferrer">White</a> is an abstraction layer over the top of Microsoft\'s <a href="http://msdn.microsoft.com/en-us/library/aa348551.aspx" rel="nofollow noreferrer">UI Automation</a> framework. I have written a similar layer that we use internally on our projects and it works great. So White would definattley be worth a look</p>\n\n<p>Microsoft have released the source to UI Automation, so if necessary you should be able to debug right down the whole stack if necessary.</p>\n\n<p>The really cool thing is that with licence cost, you can scale up and run as many machines as you like for execution.</p>\n\n<p>We run inside VSTS and link our results to requirements, but you can use c# express and nUnit and get first class tools and languages for little to no cost.</p>\n'}, {'answer_id': 623206, 'author': 'MarkJ', 'author_id': 15639, 'author_profile': 'https://Stackoverflow.com/users/15639', 'pm_score': 2, 'selected': False, 'text': '<p>Here are some links from MSDN Magazine on automatic testing code: </p>\n\n<ul>\n<li>Using UIAutomation <a href="http://msdn.microsoft.com/en-us/magazine/cc163465.aspx" rel="nofollow noreferrer">Bugslayer</a> March 2007</li>\n<li>Using PowerShell <a href="http://msdn.microsoft.com/en-us/magazine/cc163301.aspx" rel="nofollow noreferrer">Test Run</a> December 2007</li>\n<li>Tester, a utility for recording mouse clicks and keystrokes, then playing them back &amp; program checking behaviour. Excellent for unmanaged code. Uses windows handles so may not work well for managed code.  <a href="http://msdn.microsoft.com/en-gb/magazine/cc301453.aspx" rel="nofollow noreferrer">Bugslayer</a> March 2002. </li>\n</ul>\n'}, {'answer_id': 42740888, 'author': 'Roemer', 'author_id': 2103218, 'author_profile': 'https://Stackoverflow.com/users/2103218', 'pm_score': 3, 'selected': False, 'text': '<p>As a new alternative, I can give you FlaUI (<a href="https://github.com/Roemer/FlaUI" rel="noreferrer">https://github.com/Roemer/FlaUI</a>). It is basically a complete re-write of white with more features and a clean code-base.</p>\n'}, {'answer_id': 43130660, 'author': 'Dariusz Woźniak', 'author_id': 297823, 'author_profile': 'https://Stackoverflow.com/users/297823', 'pm_score': 2, 'selected': False, 'text': '<h1>The list</h1>\n<p>Please check the updated list at the: <a href="https://github.com/dariusz-wozniak/List-of-Testing-Tools-and-Frameworks-for-.NET/blob/master/README.md#user-interface-testing" rel="nofollow noreferrer">List of Automated Testing (TDD/BDD/ATDD/SBE) Tools and Frameworks for .NET: User Interface Testing</a></p>\n<div class="s-table-container">\n<table class="s-table">\n<thead>\n<tr>\n<th>Framework</th>\n<th>Comment</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><a href="https://msdn.microsoft.com/en-us/library/dd286726.aspx" rel="nofollow noreferrer">Coded UI</a></td>\n<td>Discontinued</td>\n</tr>\n<tr>\n<td><a href="https://github.com/Roemer/FlaUI" rel="nofollow noreferrer">FlaUI</a></td>\n<td></td>\n</tr>\n<tr>\n<td><a href="http://nunitforms.sourceforge.net/" rel="nofollow noreferrer">NUnitForms</a></td>\n<td>Discontinued</td>\n</tr>\n<tr>\n<td><a href="https://www.froglogic.com/squish/" rel="nofollow noreferrer">Squish GUI Tester</a></td>\n<td></td>\n</tr>\n<tr>\n<td><a href="https://smartbear.com/product/testcomplete/overview/" rel="nofollow noreferrer">TestComplete</a></td>\n<td></td>\n</tr>\n<tr>\n<td><a href="https://github.com/TestStack/White" rel="nofollow noreferrer">TestStack.White</a></td>\n<td></td>\n</tr>\n<tr>\n<td><a href="https://github.com/Microsoft/WinAppDriver" rel="nofollow noreferrer">WinAppDriver</a></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n</div><h1>What Microsoft recommends</h1>\n<h2>WinAppDriver</h2>\n<p>Microsoft recommends to use <a href="https://github.com/Microsoft/WinAppDriver" rel="nofollow noreferrer">WinAppDriver</a>:</p>\n<blockquote>\n<p>Windows Application Driver (WinAppDriver) is a service to support\nSelenium-like UI Test Automation on Windows Applications. This service\nsupports testing Universal Windows Platform (UWP), Windows Forms\n(WinForms), Windows Presentation Foundation (WPF), and Classic Windows\n(Win32) apps on Windows 10 PCs.</p>\n</blockquote>\n<h2>Coded UI (Visual Studio ≤ 2019)</h2>\n<p>Previously, <a href="https://learn.microsoft.com/en-us/visualstudio/test/use-ui-automation-to-test-your-code" rel="nofollow noreferrer">Coded UI</a>, a Visual Studio built-in feature and part of the UI Automation, was recommended for application UI testing (<strong>it\'s deprecated now</strong>):</p>\n<blockquote>\n<p>Coded UI Test for automated UI-driven functional testing is\ndeprecated. Visual Studio 2019 is the last version where Coded UI Test\nwill be available. We recommend using Selenium for testing web apps\nand Appium with WinAppDriver for testing desktop and UWP apps.\nConsider Xamarin.UITest for testing iOS and Android apps using the\nNUnit test framework.</p>\n</blockquote>\n<blockquote>\n<p>Automated tests that drive your application through its user interface\n(UI) are known as <strong>coded UI tests (CUITs)</strong>. These tests include\nfunctional testing of the UI controls. They let you verify that the\nwhole application, including its user interface, is functioning\ncorrectly. Coded UI Tests are particularly useful where there is\nvalidation or other logic in the user interface, for example in a web\npage. They are also frequently used to automate an existing manual\ntest.</p>\n</blockquote>\n<p>Read more at: <a href="https://learn.microsoft.com/en-us/visualstudio/test/use-ui-automation-to-test-your-code" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/visualstudio/test/use-ui-automation-to-test-your-code</a></p>\n'}, {'answer_id': 66161827, 'author': 'fractor', 'author_id': 3051702, 'author_profile': 'https://Stackoverflow.com/users/3051702', 'pm_score': 2, 'selected': False, 'text': '<p><a href="https://github.com/microsoft/WinAppDriver" rel="nofollow noreferrer">WinAppDriver</a> is a Selenium-like UI test automation service for testing Windows applications including Windows Forms applications. It can be used with <a href="http://appium.io/" rel="nofollow noreferrer">Appium</a>, a test automation framework.</p>\n'}, {'answer_id': 66333912, 'author': 'Sumedh Soni', 'author_id': 10957992, 'author_profile': 'https://Stackoverflow.com/users/10957992', 'pm_score': 0, 'selected': False, 'text': '<p>You may also use Winium(<a href="https://github.com/2gis/Winium" rel="nofollow noreferrer">https://github.com/2gis/Winium</a>) that works on multiple Windows platform besides Windows 10 and is similar to Selenium with extra features that support controlling the application remotely.</p>\n'}]
['https://Stackoverflow.com/questions/25343', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/33/']