<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>ASP.NET</title><link>http://blogs.clearscreen.com/dtax/category/79.aspx</link><description>ASP.NET</description><managingEditor>Jesús Jiménez</managingEditor><dc:language>es-ES</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Jesús Jiménez</dc:creator><title>WatiN: Web Application Testing in .Net</title><link>http://blogs.clearscreen.com/dtax/archive/2007/01/07/5922.aspx</link><pubDate>Sun, 07 Jan 2007 05:36:00 GMT</pubDate><guid>http://blogs.clearscreen.com/dtax/archive/2007/01/07/5922.aspx</guid><wfw:comment>http://blogs.clearscreen.com/dtax/comments/5922.aspx</wfw:comment><comments>http://blogs.clearscreen.com/dtax/archive/2007/01/07/5922.aspx#Feedback</comments><slash:comments>17</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/dtax/comments/commentRss/5922.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/dtax/services/trackbacks/5922.aspx</trackback:ping><description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;Introduction&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In the project that I'm currently working I need to do an intensive UI and Functional testing to ensure that the application UI is working fine. Due to that I've been looking for a good way to do, both, UI and functional tests. Past week I came across a framework called WatiN and I decided to research about it. This post exposes what I found and I'll try to show you what impressed me of this framework from a developer point of view.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;br /&gt;What's WatiN?&lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;WatiN stands for Web Application Testing In .Net and enables web applications testing trhought Internet Explorer. WatiN is inspired on WatiR, a web application testing framework for Ruby. The way that WatiN works is very "easy", knowing that there's a lot of work behind a framework like this. WatiN let's you to open Internet Explorer instances and throught interop interact with the elements in the form. With WatiN you can get and set values from the elements in the form and you can fire events of any of the elements in the document too.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;&lt;br /&gt;Getting started&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;The API of WatiN is very nice, at least for me, and watching some code examples and digging a bit you can get benefit of this framework quickly. The first thing that we need to build a test method using WatiN is to add a reference to the WatiN.Core.dll. WatiN gives us four namespaces, furthermore of the one that we use to interact with the IE instances, WatiN.Core. These namespaces are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WatiN.Core.DialogHandlers: Provides the needed objects to manage dialogs that the browser can show to the user. Some of the handlers you can find in this namespace are for example: AlertDialogHandler, ConfirmDialogHandler, FileUploadDialogHandler, PrintDialogHandler or LogonDialogHandler. 
&lt;/li&gt;&lt;li&gt;WatiN.Core.Exceptions: Provides some specialized exceptions to allow us to control unwanted behaviors. This namespace exceptions examples are: ElementNotFoundException, IENotFoundException, TimeoutException or a generic WatiN exception, WatiNException. 
&lt;/li&gt;&lt;li&gt;WatiN.Core.Interfaces: Provides us some interfaces to extend the WatiN framework, as for example the ILogWriter interface that gives us the availability of implement our own LogWriter class. 
&lt;/li&gt;&lt;li&gt;WatiN.Core.Logging: This namespace exposes some class that will help us in order to log the actions that our test is doing. We can use the DebugLogWriter class to write log messages to the debug window or we can use the Logger class to save our logs in other ways.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Because that the scope of this post is only introductory I'll only show you the usage of the most important objects of the framework. In order to learn more about the rest of the namespaces and/or objects you can check the "References &amp;amp; Resources" section at the bottom of this post.&lt;br /&gt;&lt;br /&gt;Now that we have a brief idea of what WatiN is and what we can do with it, let's write some code to see how is the API's usage.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:b668a055-a999-44c3-8783-e0b87520b3d1" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #008080"&gt; 1&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;using&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; WatiN.Core;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;[STAThread]
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 4&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;static&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Main(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;[] args)
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 5&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; create a new Internet Explorer Instance&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 7&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;    IE ie &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; IE();
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 8&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 9&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; point it to &lt;/span&gt;&lt;span style="COLOR: #008000; TEXT-DECORATION: underline"&gt;http://www.google.com&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;10&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;    ie.GoTo(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;http://www.google.com&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;11&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;12&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; fill the search box&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;13&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;    ie.TextField(Find.ByName(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;q&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;)).TypeText(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;WatiN&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;14&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;15&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; performs click event&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;16&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;    ie.Button(Find.ByValue(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Google Search&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;)).Click();
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;17&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The previous code example opens an Internet Explorer instance and points it to &lt;a href="http://www.google.com/"&gt;&lt;font color="#669966"&gt;www.google.com&lt;/font&gt;&lt;/a&gt;, then, when the page is loaded, it searchs a textbox with name "q" and fills it value with the text "WatiN". Then I do the same I did for the textbox but, this time, looking for a button wich value is "Google Search" and then I perform the "Click()" event. If we run this console application we will see an Internet Explorer opening and doing the things we code. Isn't cool?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;br /&gt;Solving initial workarounds&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now just some comments about the above piece of code. In order to automate tasks with Internet Explorer we need to run our test under a thread that has a single-threaded apartment (STA) as apartment state. Notice that over the Main method we have an attribute that makes the thread use STA. A big question that I made myself when I came across this framework was, "And what about running this tests with NUnit?". NUnit doesn't run the tests in a thread using STA apartment state, it uses multithreaded apartment (MTA), but this isn't a big problem so we can attach a config file to NUnit test project and specify the apartment state mode that we want. Let's see how to do it:&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:953c5e03-597c-4452-b1b5-f64f6d52da73" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #008080"&gt; 1&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="COLOR: #ff00ff"&gt;xml version="1.0" encoding="utf-8" &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;configuration&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;configSections&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 4&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;sectionGroup &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;name&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="NUnit"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 5&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;section &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;name&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="TestRunner"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; type&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="System.Configuration.NameValueSectionHandler"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;sectionGroup&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 7&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;configSections&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 8&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;NUnit&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 9&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;TestRunner&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;10&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; Valid values are STA,MTA. Others ignored. &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;--&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;11&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;add &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;key&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="ApartmentState"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; value&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="STA"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;12&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;TestRunner&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;13&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;NUnit&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;14&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;configuration&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;One thing that will occur after executing the above code is that the Internet Explorer window stills open. If you run more than one test, supposing you use NUnit, you can do two things. First, you can create the instance of the IE object using the "using" keyword and using the constructor that lets us specify the url. If you do that it gets closed and disposed after test execution. Second, you can call the Close() method of the IE instace to programmatically close the window. Both are valid, but I prefer the first one becuase I think that the resulting code is more elegant that if we use the second one.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;br /&gt;Creating our first UI test&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If our test result is based on the response that the server sends back to the browser, we can parse the response in order to know if our test has failed or not. The way that we do that is exactly the same that we use to make the test, but searching other items in the page that help us to identify what happend. Suppose that we have an aspx page like this:&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:007b04c4-8078-4d23-9c48-62933094936b" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #008080"&gt; 1&lt;/span&gt; &lt;span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;@ Page Language&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;C#&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt; AutoEventWireup&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;true&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt; CodeFile&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;Default.aspx.cs&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt; Inherits&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;_Default&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="COLOR: #ff00ff"&gt;DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;html &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 4&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;head &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="server"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 5&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;title&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;WatiN Test Page&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;title&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;head&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 7&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;body&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 8&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;form &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;id&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="form1"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; runat&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="server"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 9&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;h2&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Check if a nickname is already used&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;h2&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;10&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;table&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;11&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;tr&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;12&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;td&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Nickname:&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;td&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;13&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;td&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;asp:TextBox &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="server"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; ID&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="txtNickName"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;td&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;14&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;tr&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;15&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;tr&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;16&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;td &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;colspan&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="2"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; align&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="right"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;17&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;asp:Button &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="server"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; ID&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="btnCheck"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; Text&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="Check !!"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; OnClick&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="btnCheck_Click"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;18&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;td&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;19&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;tr&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;20&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;tr&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;21&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;td &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;colspan&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="2"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;22&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;asp:Label &lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="server"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; ID&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="lblResult"&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;23&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;td&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;24&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;tr&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;25&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;table&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;26&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;form&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;27&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;body&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;28&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;html&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;And now suppose that we have this code on the btnCheck.OnClick event:&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:4ea1a60c-f00b-4166-b33b-4a4fa9f6807c" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #008080"&gt;1&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;protected&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; btnCheck_Click(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; sender, EventArgs e)
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; do some logic to check if the nickname is already used.
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;4&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; i'll return true for all nicknames but "gsus"&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;5&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; (txtNickName.Text &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;!=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;gsus&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;)
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        lblResult.Text &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;The nickname is already in use&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;7&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;else&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;8&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        lblResult.Text &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;The nickname is not used&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;9&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;I'm writing this post examples in Visual Studio 2005 and running under Windows Vista, so I don't have Internet Information Services installed. For web development I'm using the ASP.NET Development Server that came with .Net Framework 2.0 so in the next code sample you will see that I start programmatically the Web Server in order to run the test. I'm not a "tests" guru, so I don't really know if my test is the best test of the world, the only thing I'm trying to transmit you is the concept of how it will be done, of course if I'm wrong, your comments are welcome. Now let's see how my test looks finally:&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:0ada9654-15c4-4eb3-b82d-3cd47d801987" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #008080"&gt; 1&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;using&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; System.Diagnostics;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;using&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; WatiN.Core;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;using&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; NUnit.Framework;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 4&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;using&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; System;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 5&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;namespace&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; WebAppUITesting
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 7&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 8&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    [TestFixture]
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 9&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;class&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; UITesting
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;10&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;11&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;process object &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;12&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;private&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Process p;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;13&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;14&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        [TestFixtureSetUpAttribute]
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;15&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; SetUp()
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;16&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        {            
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;17&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; create a new process to start the ASP.Net Development Server&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;18&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;            p &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Process();
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;19&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;20&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; set the initial properties &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;21&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; path &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Environment.CurrentDirectory.Replace(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;@"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;WebAppUITesting\bin&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;, &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;.Empty);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;22&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            p.StartInfo.FileName &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;WebDev.WebServer.EXE&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;23&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            p.StartInfo.Arguments &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; String.Format(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;/port:8080 /path:\"{0}WebApp\"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;, path);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;24&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            p.StartInfo.WindowStyle &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ProcessWindowStyle.Minimized;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;25&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;26&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; start the process&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;27&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;            p.Start();
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;28&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;29&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;30&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        [Test]
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;31&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; CheckIfNicknameIsNotUsed()
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;32&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;33&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; create a new Internet Explorer instance pointing to the ASP.NET Development Server&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;34&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;using&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; (IE ie &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; IE(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;http://localhost:8080/Default.aspx&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;))
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;35&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;36&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; Maximize the IE window in order to view test&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;37&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;                ie.ShowWindow(NativeMethods.WindowShowStyle.Maximize);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;38&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;39&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; search for txtNickName and type "gsus" in it&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;40&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;                ie.TextField(Find.ById(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;txtNickName&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;)).TypeText(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;gsus&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;41&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;42&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; fire the click event of the button&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;43&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;                ie.Button(Find.ById(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;btnCheck&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;)).Click();
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;44&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;45&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;                &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; parse the response in order to fail the test or not &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;46&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;                Assert.AreEqual(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;true&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;, ie.ContainsText(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;The nickname is not used&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;));
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;47&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            }            
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;48&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;49&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;50&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        [TestFixtureTearDownAttribute]
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;51&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; TearDown()
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;52&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;53&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; kill the ASP.NET Development Server process&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;54&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;            p.Kill();
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;55&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;56&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;57&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;As you can see I use the method ContainsText in line 46. This method searchs the specified text in the document content and returns a bool indicating if there are occurrences in the search. We can replace the line 46 with the next code example, where I directly get the "lblResult" span content to see if the nickname is already used:&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:23037fa2-b052-444e-b6ce-a69bb5a8fda3" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #008080"&gt;1&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; parse the response in order to fail the test or not &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;2&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;bool&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; result &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; (ie.Span(Find.ById(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;lblResult&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;)).Text &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;==&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;The nickname is not used&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;Assert.AreEqual(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;true&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;, result);&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;strong&gt;&lt;u&gt;&lt;br /&gt;&lt;br /&gt;Conclusion&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;At this point, you should know how to basically use WatiN framework to test your web applications. I hope you find this framework and this post useful as I did. Personally I haven't used any other web application testing framework but I get really surprised with how we can test our UI using WatiN. I think that we can do an intesive UI and functional testing with it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&lt;br /&gt;References &amp;amp; Resources&lt;/u&gt;&lt;/strong&gt; 
&lt;p&gt;References:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WatiN Homepage: &lt;a href="http://watin.sourceforge.net/"&gt;&lt;font color="#669966"&gt;http://watin.sourceforge.net/&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;WatiN MSDN style documentation: &lt;a href="http://watin.sourceforge.net/doc/index.html"&gt;&lt;font color="#669966"&gt;http://watin.sourceforge.net/doc/index.html&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;WatiN Getting Started: &lt;a href="http://watin.sourceforge.net/gettingstarted.html"&gt;&lt;font color="#669966"&gt;http://watin.sourceforge.net/gettingstarted.html&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;WatiN and ApartmentState: &lt;a href="http://watin.sourceforge.net/apartmentstateinfo.ht..."&gt;&lt;font color="#669966"&gt;http://watin.sourceforge.net/apartmentstateinfo.ht...&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;WatiR (Web Application Testing in Ruby): &lt;a href="http://wtr.rubyforge.org/"&gt;&lt;font color="#669966"&gt;http://wtr.rubyforge.org/&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;ASP.NET Development Server: &lt;a href="http://msdn2.microsoft.com/en-us/library/58wxa9w5(VS.80).aspx"&gt;&lt;font color="#669966"&gt;http://msdn2.microsoft.com/en-us/library/58wxa9w5(...&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WatiN Framework for .Net 1.1: &lt;a href="http://downloads.sourceforge.net/watin/WatiN-0.9.5.4000-net-1.1.zip?modtime=1167604846&amp;amp;big_mirror=0"&gt;&lt;font color="#669966"&gt;WatiN-0.9.5.4000-net-1.1.zip&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;WatiN Framework for .Net 2.0: &lt;a href="http://downloads.sourceforge.net/watin/WatiN-0.9.5.4000-net-2.0.zip?modtime=1167604860&amp;amp;big_mirror=0"&gt;&lt;font color="#669966"&gt;WatiN-0.9.5.4000-net-2.0.zip&lt;/font&gt;&lt;/a&gt; 
&lt;/li&gt;&lt;li&gt;This post examples source code: &lt;a href="http://blogs.clearscreen.com/dtax/files/WatiN_Examples.zip"&gt;&lt;font color="#669966"&gt;http://blogs.clearscreen.com/dtax/files/WatiN_Examples.zip&lt;/font&gt;&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;img src ="http://blogs.clearscreen.com/dtax/aggbug/5922.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p><strong><u>Introduction</u></strong><br /><br />In the project that I'm currently working I need to do an intensive UI and Functional testing to ensure that the application UI is working fine. Due to that I've been looking for a good way to do, both, UI and functional tests. Past week I came across a framework called WatiN and I decided to research about it. This post exposes what I found and I'll try to show you what impressed me of this framework from a developer point of view.<br /><br /><strong><u><br />What's WatiN?<br /></u></strong><br />WatiN stands for Web Application Testing In .Net and enables web applications testing trhought Internet Explorer. WatiN is inspired on WatiR, a web application testing framework for Ruby. The way that WatiN works is very "easy", knowing that there's a lot of work behind a framework like this. WatiN let's you to open Internet Explorer instances and throught interop interact with the elements in the form. With WatiN you can get and set values from the elements in the form and you can fire events of any of the elements in the document too.<br /><br /><u><strong><br />Getting started</strong></u><br /><br />The API of WatiN is very nice, at least for me, and watching some code examples and digging a bit you can get benefit of this framework quickly. The first thing that we need to build a test method using WatiN is to add a reference to the WatiN.Core.dll. WatiN gives us four namespaces, furthermore of the one that we use to interact with the IE instances, WatiN.Core. These namespaces are:</p>
<ul>
<li>WatiN.Core.DialogHandlers: Provides the needed objects to manage dialogs that the browser can show to the user. Some of the handlers you can find in this namespace are for example: AlertDialogHandler, ConfirmDialogHandler, FileUploadDialogHandler, PrintDialogHandler or LogonDialogHandler. 
</li><li>WatiN.Core.Exceptions: Provides some specialized exceptions to allow us to control unwanted behaviors. This namespace exceptions examples are: ElementNotFoundException, IENotFoundException, TimeoutException or a generic WatiN exception, WatiNException. 
</li><li>WatiN.Core.Interfaces: Provides us some interfaces to extend the WatiN framework, as for example the ILogWriter interface that gives us the availability of implement our own LogWriter class. 
</li><li>WatiN.Core.Logging: This namespace exposes some class that will help us in order to log the actions that our test is doing. We can use the DebugLogWriter class to write log messages to the debug window or we can use the Logger class to save our logs in other ways.</li></ul>
<p>Because that the scope of this post is only introductory I'll only show you the usage of the most important objects of the framework. In order to learn more about the rest of the namespaces and/or objects you can check the "References &amp; Resources" section at the bottom of this post.<br /><br />Now that we have a brief idea of what WatiN is and what we can do with it, let's write some code to see how is the API's usage.</p>
<p></p>
<p></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:b668a055-a999-44c3-8783-e0b87520b3d1" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><pre style="BACKGROUND-COLOR: white"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="COLOR: #008080"> 1</span> <span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> WatiN.Core;
</span><span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 3</span> <span style="COLOR: #000000">[STAThread]
</span><span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> Main(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">[] args)
</span><span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000">    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> create a new Internet Explorer Instance</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080"> 7</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">    IE ie </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> IE();
</span><span style="COLOR: #008080"> 8</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> point it to </span><span style="COLOR: #008000; TEXT-DECORATION: underline">http://www.google.com</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">10</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">    ie.GoTo(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">http://www.google.com</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);
</span><span style="COLOR: #008080">11</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">12</span> <span style="COLOR: #000000">    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> fill the search box</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">13</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">    ie.TextField(Find.ByName(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">q</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)).TypeText(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">WatiN</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);
</span><span style="COLOR: #008080">14</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">15</span> <span style="COLOR: #000000">    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> performs click event</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">16</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">    ie.Button(Find.ByValue(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Google Search</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)).Click();
</span><span style="COLOR: #008080">17</span> <span style="COLOR: #000000">}</span></div></pre></div><br />The previous code example opens an Internet Explorer instance and points it to <a href="http://www.google.com/"><font color="#669966">www.google.com</font></a>, then, when the page is loaded, it searchs a textbox with name "q" and fills it value with the text "WatiN". Then I do the same I did for the textbox but, this time, looking for a button wich value is "Google Search" and then I perform the "Click()" event. If we run this console application we will see an Internet Explorer opening and doing the things we code. Isn't cool?<br /><br /><strong><u><br />Solving initial workarounds</u></strong><br /><br />Now just some comments about the above piece of code. In order to automate tasks with Internet Explorer we need to run our test under a thread that has a single-threaded apartment (STA) as apartment state. Notice that over the Main method we have an attribute that makes the thread use STA. A big question that I made myself when I came across this framework was, "And what about running this tests with NUnit?". NUnit doesn't run the tests in a thread using STA apartment state, it uses multithreaded apartment (MTA), but this isn't a big problem so we can attach a config file to NUnit test project and specify the apartment state mode that we want. Let's see how to do it:<br /><br />
<p></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:953c5e03-597c-4452-b1b5-f64f6d52da73" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><pre style="BACKGROUND-COLOR: white"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="COLOR: #008080"> 1</span> <span style="COLOR: #0000ff">&lt;?</span><span style="COLOR: #ff00ff">xml version="1.0" encoding="utf-8" </span><span style="COLOR: #0000ff">?&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">configuration</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 3</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">configSections</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">sectionGroup </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="NUnit"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">section </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="TestRunner"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="System.Configuration.NameValueSectionHandler"</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">sectionGroup</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">configSections</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 8</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">NUnit</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">TestRunner</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">10</span> <span style="COLOR: #000000">            </span><span style="COLOR: #008000">&lt;!--</span><span style="COLOR: #008000"> Valid values are STA,MTA. Others ignored. </span><span style="COLOR: #008000">--&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">11</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">add </span><span style="COLOR: #ff0000">key</span><span style="COLOR: #0000ff">="ApartmentState"</span><span style="COLOR: #ff0000"> value</span><span style="COLOR: #0000ff">="STA"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">12</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">TestRunner</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">13</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">NUnit</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">14</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">configuration</span><span style="COLOR: #0000ff">&gt;</span></div></pre></div><br />One thing that will occur after executing the above code is that the Internet Explorer window stills open. If you run more than one test, supposing you use NUnit, you can do two things. First, you can create the instance of the IE object using the "using" keyword and using the constructor that lets us specify the url. If you do that it gets closed and disposed after test execution. Second, you can call the Close() method of the IE instace to programmatically close the window. Both are valid, but I prefer the first one becuase I think that the resulting code is more elegant that if we use the second one.<br /><br /><strong><u><br />Creating our first UI test</u></strong><br /><br />If our test result is based on the response that the server sends back to the browser, we can parse the response in order to know if our test has failed or not. The way that we do that is exactly the same that we use to make the test, but searching other items in the page that help us to identify what happend. Suppose that we have an aspx page like this:<br /><br />
<p></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:007b04c4-8078-4d23-9c48-62933094936b" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><pre style="BACKGROUND-COLOR: white"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="COLOR: #008080"> 1</span> <span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@ Page Language</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">C#</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> AutoEventWireup</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">true</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> CodeFile</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Default.aspx.cs</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> Inherits</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">_Default</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">&lt;!</span><span style="COLOR: #ff00ff">DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 3</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">html </span><span style="COLOR: #ff0000">xmlns</span><span style="COLOR: #0000ff">="http://www.w3.org/1999/xhtml"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">head </span><span style="COLOR: #ff0000">runat</span><span style="COLOR: #0000ff">="server"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">WatiN Test Page</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 8</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">form </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="form1"</span><span style="COLOR: #ff0000"> runat</span><span style="COLOR: #0000ff">="server"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">h2</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">Check if a nickname is already used</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">h2</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">10</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">table</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">11</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">12</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">Nickname:</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">13</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">asp:TextBox </span><span style="COLOR: #ff0000">runat</span><span style="COLOR: #0000ff">="server"</span><span style="COLOR: #ff0000"> ID</span><span style="COLOR: #0000ff">="txtNickName"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/&gt;&lt;/</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">14</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">15</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">16</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">td </span><span style="COLOR: #ff0000">colspan</span><span style="COLOR: #0000ff">="2"</span><span style="COLOR: #ff0000"> align</span><span style="COLOR: #0000ff">="right"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">17</span> <span style="COLOR: #000000">                    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">asp:Button </span><span style="COLOR: #ff0000">runat</span><span style="COLOR: #0000ff">="server"</span><span style="COLOR: #ff0000"> ID</span><span style="COLOR: #0000ff">="btnCheck"</span><span style="COLOR: #ff0000"> Text</span><span style="COLOR: #0000ff">="Check !!"</span><span style="COLOR: #ff0000"> OnClick</span><span style="COLOR: #0000ff">="btnCheck_Click"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">18</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">19</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">20</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">21</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">td </span><span style="COLOR: #ff0000">colspan</span><span style="COLOR: #0000ff">="2"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">22</span> <span style="COLOR: #000000">                    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">asp:Label </span><span style="COLOR: #ff0000">runat</span><span style="COLOR: #0000ff">="server"</span><span style="COLOR: #ff0000"> ID</span><span style="COLOR: #0000ff">="lblResult"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">23</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">24</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">25</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">table</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">26</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">form</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">27</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">28</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span></div></pre></div><br />And now suppose that we have this code on the btnCheck.OnClick event:<br /><br />
<p></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:4ea1a60c-f00b-4166-b33b-4a4fa9f6807c" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><pre style="BACKGROUND-COLOR: white"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="COLOR: #008080">1</span> <span style="COLOR: #0000ff">protected</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> btnCheck_Click(</span><span style="COLOR: #0000ff">object</span><span style="COLOR: #000000"> sender, EventArgs e)
</span><span style="COLOR: #008080">2</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080">3</span> <span style="COLOR: #000000">    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> do some logic to check if the nickname is already used.
</span><span style="COLOR: #008080">4</span> <span style="COLOR: #008000">    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> i'll return true for all nicknames but "gsus"</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">5</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (txtNickName.Text </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">gsus</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)
</span><span style="COLOR: #008080">6</span> <span style="COLOR: #000000">        lblResult.Text </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">The nickname is already in use</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;
</span><span style="COLOR: #008080">7</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">8</span> <span style="COLOR: #000000">        lblResult.Text </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">The nickname is not used</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;
</span><span style="COLOR: #008080">9</span> <span style="COLOR: #000000">}</span></div></pre></div><br />I'm writing this post examples in Visual Studio 2005 and running under Windows Vista, so I don't have Internet Information Services installed. For web development I'm using the ASP.NET Development Server that came with .Net Framework 2.0 so in the next code sample you will see that I start programmatically the Web Server in order to run the test. I'm not a "tests" guru, so I don't really know if my test is the best test of the world, the only thing I'm trying to transmit you is the concept of how it will be done, of course if I'm wrong, your comments are welcome. Now let's see how my test looks finally:<br /><br />
<p></p>
<p></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:0ada9654-15c4-4eb3-b82d-3cd47d801987" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><pre style="BACKGROUND-COLOR: white"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="COLOR: #008080"> 1</span> <span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> System.Diagnostics;
</span><span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> WatiN.Core;
</span><span style="COLOR: #008080"> 3</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> NUnit.Framework;
</span><span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> System;
</span><span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> WebAppUITesting
</span><span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080"> 8</span> <span style="COLOR: #000000">    [TestFixture]
</span><span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> UITesting
</span><span style="COLOR: #008080">10</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">11</span> <span style="COLOR: #000000">        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">process object </span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">12</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000"> Process p;
</span><span style="COLOR: #008080">13</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">14</span> <span style="COLOR: #000000">        [TestFixtureSetUpAttribute]
</span><span style="COLOR: #008080">15</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> SetUp()
</span><span style="COLOR: #008080">16</span> <span style="COLOR: #000000">        {            
</span><span style="COLOR: #008080">17</span> <span style="COLOR: #000000">            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> create a new process to start the ASP.Net Development Server</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">18</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">            p </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Process();
</span><span style="COLOR: #008080">19</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">20</span> <span style="COLOR: #000000">            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> set the initial properties </span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">21</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000"> path </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> Environment.CurrentDirectory.Replace(</span><span style="COLOR: #000000">@"</span><span style="COLOR: #000000">WebAppUITesting\bin</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.Empty);
</span><span style="COLOR: #008080">22</span> <span style="COLOR: #000000">            p.StartInfo.FileName </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">WebDev.WebServer.EXE</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;
</span><span style="COLOR: #008080">23</span> <span style="COLOR: #000000">            p.StartInfo.Arguments </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> String.Format(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/port:8080 /path:\"{0}WebApp\"</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, path);
</span><span style="COLOR: #008080">24</span> <span style="COLOR: #000000">            p.StartInfo.WindowStyle </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> ProcessWindowStyle.Minimized;
</span><span style="COLOR: #008080">25</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">26</span> <span style="COLOR: #000000">            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> start the process</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">27</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">            p.Start();
</span><span style="COLOR: #008080">28</span> <span style="COLOR: #000000">        }
</span><span style="COLOR: #008080">29</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">30</span> <span style="COLOR: #000000">        [Test]
</span><span style="COLOR: #008080">31</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> CheckIfNicknameIsNotUsed()
</span><span style="COLOR: #008080">32</span> <span style="COLOR: #000000">        {
</span><span style="COLOR: #008080">33</span> <span style="COLOR: #000000">            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> create a new Internet Explorer instance pointing to the ASP.NET Development Server</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">34</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> (IE ie </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> IE(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">http://localhost:8080/Default.aspx</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))
</span><span style="COLOR: #008080">35</span> <span style="COLOR: #000000">            {
</span><span style="COLOR: #008080">36</span> <span style="COLOR: #000000">                </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Maximize the IE window in order to view test</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">37</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">                ie.ShowWindow(NativeMethods.WindowShowStyle.Maximize);
</span><span style="COLOR: #008080">38</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">39</span> <span style="COLOR: #000000">                </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> search for txtNickName and type "gsus" in it</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">40</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">                ie.TextField(Find.ById(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">txtNickName</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)).TypeText(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">gsus</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);
</span><span style="COLOR: #008080">41</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">42</span> <span style="COLOR: #000000">                </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> fire the click event of the button</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">43</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">                ie.Button(Find.ById(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">btnCheck</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)).Click();
</span><span style="COLOR: #008080">44</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">45</span> <span style="COLOR: #000000">                </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> parse the response in order to fail the test or not </span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">46</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">                Assert.AreEqual(</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">, ie.ContainsText(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">The nickname is not used</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));
</span><span style="COLOR: #008080">47</span> <span style="COLOR: #000000">            }            
</span><span style="COLOR: #008080">48</span> <span style="COLOR: #000000">        }
</span><span style="COLOR: #008080">49</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">50</span> <span style="COLOR: #000000">        [TestFixtureTearDownAttribute]
</span><span style="COLOR: #008080">51</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> TearDown()
</span><span style="COLOR: #008080">52</span> <span style="COLOR: #000000">        {
</span><span style="COLOR: #008080">53</span> <span style="COLOR: #000000">            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> kill the ASP.NET Development Server process</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">54</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">            p.Kill();
</span><span style="COLOR: #008080">55</span> <span style="COLOR: #000000">        }
</span><span style="COLOR: #008080">56</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">57</span> <span style="COLOR: #000000">}</span></div></pre></div><br />As you can see I use the method ContainsText in line 46. This method searchs the specified text in the document content and returns a bool indicating if there are occurrences in the search. We can replace the line 46 with the next code example, where I directly get the "lblResult" span content to see if the nickname is already used:<br /><br />
<p></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:23037fa2-b052-444e-b6ce-a69bb5a8fda3" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><pre style="BACKGROUND-COLOR: white"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="COLOR: #008080">1</span> <span style="COLOR: #008000">//</span><span style="COLOR: #008000"> parse the response in order to fail the test or not </span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">2</span> <span style="COLOR: #008000"></span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> result </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> (ie.Span(Find.ById(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">lblResult</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)).Text </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">The nickname is not used</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);
</span><span style="COLOR: #008080">3</span> <span style="COLOR: #000000">Assert.AreEqual(</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">, result);</span></div></pre></div><strong><u><br /><br />Conclusion</u></strong><br /><br />At this point, you should know how to basically use WatiN framework to test your web applications. I hope you find this framework and this post useful as I did. Personally I haven't used any other web application testing framework but I get really surprised with how we can test our UI using WatiN. I think that we can do an intesive UI and functional testing with it.<br /><br /><strong><u><br />References &amp; Resources</u></strong> 
<p>References:</p>
<ul>
<li>WatiN Homepage: <a href="http://watin.sourceforge.net/"><font color="#669966">http://watin.sourceforge.net/</font></a> 
</li><li>WatiN MSDN style documentation: <a href="http://watin.sourceforge.net/doc/index.html"><font color="#669966">http://watin.sourceforge.net/doc/index.html</font></a> 
</li><li>WatiN Getting Started: <a href="http://watin.sourceforge.net/gettingstarted.html"><font color="#669966">http://watin.sourceforge.net/gettingstarted.html</font></a> 
</li><li>WatiN and ApartmentState: <a href="http://watin.sourceforge.net/apartmentstateinfo.ht..."><font color="#669966">http://watin.sourceforge.net/apartmentstateinfo.ht...</font></a> 
</li><li>WatiR (Web Application Testing in Ruby): <a href="http://wtr.rubyforge.org/"><font color="#669966">http://wtr.rubyforge.org/</font></a> 
</li><li>ASP.NET Development Server: <a href="http://msdn2.microsoft.com/en-us/library/58wxa9w5(VS.80).aspx"><font color="#669966">http://msdn2.microsoft.com/en-us/library/58wxa9w5(...</font></a></li></ul>
<p>Resources:</p>
<ul>
<li>WatiN Framework for .Net 1.1: <a href="http://downloads.sourceforge.net/watin/WatiN-0.9.5.4000-net-1.1.zip?modtime=1167604846&amp;big_mirror=0"><font color="#669966">WatiN-0.9.5.4000-net-1.1.zip</font></a> 
</li><li>WatiN Framework for .Net 2.0: <a href="http://downloads.sourceforge.net/watin/WatiN-0.9.5.4000-net-2.0.zip?modtime=1167604860&amp;big_mirror=0"><font color="#669966">WatiN-0.9.5.4000-net-2.0.zip</font></a> 
</li><li>This post examples source code: <a href="http://blogs.clearscreen.com/dtax/files/WatiN_Examples.zip"><font color="#669966">http://blogs.clearscreen.com/dtax/files/WatiN_Examples.zip</font></a> </li></ul><img src ="http://blogs.clearscreen.com/dtax/aggbug/5922.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Jesús Jiménez</dc:creator><title>Security How Tos</title><link>http://blogs.clearscreen.com/dtax/archive/2006/02/25/2855.aspx</link><pubDate>Sat, 25 Feb 2006 12:20:00 GMT</pubDate><guid>http://blogs.clearscreen.com/dtax/archive/2006/02/25/2855.aspx</guid><wfw:comment>http://blogs.clearscreen.com/dtax/comments/2855.aspx</wfw:comment><comments>http://blogs.clearscreen.com/dtax/archive/2006/02/25/2855.aspx#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/dtax/comments/commentRss/2855.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/dtax/services/trackbacks/2855.aspx</trackback:ping><description>&lt;p&gt;Patterns &amp;amp; Pratices has very good Security How Tos articles most of them rated 9 of 9. The topics of this articles applies to a lot of  issues that surely got crazy many of you (and me). Take a look at: &lt;a href="http://msdn.microsoft.com/library/en-us/dnpag2/html/SecurityHowTosIndex.asp?frame=true"&gt;http://msdn.microsoft.com/library/en-us/dnpag2/html/SecurityHowTosIndex.asp?frame=true&lt;/a&gt;&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/dtax/aggbug/2855.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Patterns &amp; Pratices has very good Security How Tos articles most of them rated 9 of 9. The topics of this articles applies to a lot of  issues that surely got crazy many of you (and me). Take a look at: <a href="http://msdn.microsoft.com/library/en-us/dnpag2/html/SecurityHowTosIndex.asp?frame=true">http://msdn.microsoft.com/library/en-us/dnpag2/html/SecurityHowTosIndex.asp?frame=true</a></p><img src ="http://blogs.clearscreen.com/dtax/aggbug/2855.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Jesús Jiménez</dc:creator><title>My new project</title><link>http://blogs.clearscreen.com/dtax/archive/2005/09/26/2436.aspx</link><pubDate>Mon, 26 Sep 2005 13:15:00 GMT</pubDate><guid>http://blogs.clearscreen.com/dtax/archive/2005/09/26/2436.aspx</guid><wfw:comment>http://blogs.clearscreen.com/dtax/comments/2436.aspx</wfw:comment><comments>http://blogs.clearscreen.com/dtax/archive/2005/09/26/2436.aspx#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/dtax/comments/commentRss/2436.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/dtax/services/trackbacks/2436.aspx</trackback:ping><description>&lt;p&gt;Today is my first day in a new company. New developers team and project.&lt;/p&gt;
&lt;p&gt;Now I'm working for Ono, a big Cable ISP in Spain.&lt;br /&gt;The project where I 'm going enter in consists on trasmiting video over internet using ASP.NET 1.1, C# + Remoting + Sockets, SQL Server2000 and Windows Media SDK 9.&lt;br /&gt;Ono offers to their clients a client application that controls your WebCam and broadcast video over internet. This client application connects to a Windows Media Server that manages the video that the client application is broadcasting. Otherside there's a Web application that lists all the clients application that are broadcasting where everyone (If you don't protect it with a username and a password) can see the video that the client WebCam are catching.&lt;/p&gt;
&lt;p&gt;Overall, I think that I'm gonna learn a lot about Windows Media Server and Player, and all Windows Media SDK.&lt;/p&gt;
&lt;p&gt;I think, I'll learn a lot of interestings things to post here.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/dtax/aggbug/2436.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Today is my first day in a new company. New developers team and project.</p>
<p>Now I'm working for Ono, a big Cable ISP in Spain.<br />The project where I 'm going enter in consists on trasmiting video over internet using ASP.NET 1.1, C# + Remoting + Sockets, SQL Server2000 and Windows Media SDK 9.<br />Ono offers to their clients a client application that controls your WebCam and broadcast video over internet. This client application connects to a Windows Media Server that manages the video that the client application is broadcasting. Otherside there's a Web application that lists all the clients application that are broadcasting where everyone (If you don't protect it with a username and a password) can see the video that the client WebCam are catching.</p>
<p>Overall, I think that I'm gonna learn a lot about Windows Media Server and Player, and all Windows Media SDK.</p>
<p>I think, I'll learn a lot of interestings things to post here.</p><img src ="http://blogs.clearscreen.com/dtax/aggbug/2436.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Jesús Jiménez</dc:creator><title>ASP.NET AJAX Progress bar</title><link>http://blogs.clearscreen.com/dtax/archive/2005/09/05/2401.aspx</link><pubDate>Mon, 05 Sep 2005 10:52:00 GMT</pubDate><guid>http://blogs.clearscreen.com/dtax/archive/2005/09/05/2401.aspx</guid><wfw:comment>http://blogs.clearscreen.com/dtax/comments/2401.aspx</wfw:comment><comments>http://blogs.clearscreen.com/dtax/archive/2005/09/05/2401.aspx#Feedback</comments><slash:comments>13</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/dtax/comments/commentRss/2401.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/dtax/services/trackbacks/2401.aspx</trackback:ping><description>&lt;p&gt;The summer is ending and all the people like me are coming back to the city. I have thought that posting in english has more projection so my next posts will be in english, bad english. ;)&lt;/p&gt;
&lt;p&gt;While I was reading loads of posts after my holidays I found one post from &lt;a href="http://codebetter.com/blogs/sahil.malik/default.aspx"&gt;Sahil Malik&lt;/a&gt;, an interesting reading that shows &lt;a href="http://codebetter.com/blogs/sahil.malik/archive/2005/08/26/131340.aspx"&gt;how to create a progress bar with AJAX&lt;/a&gt; while we are performing long tasks with data.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/dtax/aggbug/2401.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>The summer is ending and all the people like me are coming back to the city. I have thought that posting in english has more projection so my next posts will be in english, bad english. ;)</p>
<p>While I was reading loads of posts after my holidays I found one post from <a href="http://codebetter.com/blogs/sahil.malik/default.aspx">Sahil Malik</a>, an interesting reading that shows <a href="http://codebetter.com/blogs/sahil.malik/archive/2005/08/26/131340.aspx">how to create a progress bar with AJAX</a> while we are performing long tasks with data.</p><img src ="http://blogs.clearscreen.com/dtax/aggbug/2401.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Jesús Jiménez</dc:creator><title>¿Cuanto sabes de Visual Studio 2005 y SQL Server 2005?</title><link>http://blogs.clearscreen.com/dtax/archive/2005/06/08/1873.aspx</link><pubDate>Wed, 08 Jun 2005 12:47:00 GMT</pubDate><guid>http://blogs.clearscreen.com/dtax/archive/2005/06/08/1873.aspx</guid><wfw:comment>http://blogs.clearscreen.com/dtax/comments/1873.aspx</wfw:comment><comments>http://blogs.clearscreen.com/dtax/archive/2005/06/08/1873.aspx#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/dtax/comments/commentRss/1873.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/dtax/services/trackbacks/1873.aspx</trackback:ping><description>&lt;p&gt;Ayer vi que en la MSDN, en el apartado de Learning, hay una serie de tests para medir tu conocimiento sobre distintas materias. Estos tests son clavados (en estilo) a las certificaciones y aparte de tests sobre Windows XP, Windows 2003, SQL Server, Exchange Server, Seguridad, Visual Studio 2003 y otros temas, curiosamente hay de &lt;a href="http://assessment.learning.microsoft.com/test/home.asp#15"&gt;Visual Studio 2005&lt;/a&gt;  con dos tests y de &lt;a href="http://assessment.learning.microsoft.com/test/home.asp#14"&gt;SQL Server 2005&lt;/a&gt; con tres tests.&lt;br /&gt;&lt;br /&gt;· What's New in Microsoft® Visual Studio® 2005&lt;br /&gt;· What's New in ASP.NET 2.0&lt;br /&gt;· Introducing Microsoft® SQL Server™ 2005 for Database Administrators&lt;br /&gt;· Introducing Microsoft® SQL Server™ 2005 for Database Developers&lt;br /&gt;· Introducing Microsoft® SQL Server™ 2005 for Business Intelligence Developers&lt;br /&gt;&lt;br /&gt;Yo hice el de ASP.NET 2.0 y saque un mediocre 60%, aunque teniendo en cuenta que aún no me he peleado en un proyecto real con esta tecnología no esta nada mal. Lo que me parecio bastante bien es que hacen "estudio" personalizado de que deberias reforzar según tu resultado del test y te indican que MOCs incluyen el temario que necesitas.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/dtax/aggbug/1873.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Ayer vi que en la MSDN, en el apartado de Learning, hay una serie de tests para medir tu conocimiento sobre distintas materias. Estos tests son clavados (en estilo) a las certificaciones y aparte de tests sobre Windows XP, Windows 2003, SQL Server, Exchange Server, Seguridad, Visual Studio 2003 y otros temas, curiosamente hay de <a href="http://assessment.learning.microsoft.com/test/home.asp#15">Visual Studio 2005</a>  con dos tests y de <a href="http://assessment.learning.microsoft.com/test/home.asp#14">SQL Server 2005</a> con tres tests.<br /><br />· What's New in Microsoft® Visual Studio® 2005<br />· What's New in ASP.NET 2.0<br />· Introducing Microsoft® SQL Server™ 2005 for Database Administrators<br />· Introducing Microsoft® SQL Server™ 2005 for Database Developers<br />· Introducing Microsoft® SQL Server™ 2005 for Business Intelligence Developers<br /><br />Yo hice el de ASP.NET 2.0 y saque un mediocre 60%, aunque teniendo en cuenta que aún no me he peleado en un proyecto real con esta tecnología no esta nada mal. Lo que me parecio bastante bien es que hacen "estudio" personalizado de que deberias reforzar según tu resultado del test y te indican que MOCs incluyen el temario que necesitas.</p><img src ="http://blogs.clearscreen.com/dtax/aggbug/1873.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Jesús Jiménez</dc:creator><title>ASP.NET Free controls and components</title><link>http://blogs.clearscreen.com/dtax/archive/2005/04/10/1342.aspx</link><pubDate>Sun, 10 Apr 2005 23:42:00 GMT</pubDate><guid>http://blogs.clearscreen.com/dtax/archive/2005/04/10/1342.aspx</guid><wfw:comment>http://blogs.clearscreen.com/dtax/comments/1342.aspx</wfw:comment><comments>http://blogs.clearscreen.com/dtax/archive/2005/04/10/1342.aspx#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/dtax/comments/commentRss/1342.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/dtax/services/trackbacks/1342.aspx</trackback:ping><description>&lt;p&gt;Leyendo el blog de &lt;a href="http://weblogs.asp.net/cweyer/"&gt;Christian Weyer&lt;/a&gt; he encontrado &lt;a href="http://weblogs.asp.net/cweyer/archive/2005/03/18/395197.aspx"&gt;un post&lt;/a&gt; muy interesante en el que hablaba de &lt;a href="http://aspalliance.com/articleViewer.aspx?aId=652&amp;amp;pId=2"&gt;un articulo de ASP Alliance&lt;/a&gt; donde Jason N. Gaylord hace una magnífica recopilación de muchos controles y componentes para ASP.NET que son gratuitos. Muchos de ellos emulan algunas de las nuevas funcionalidades que nos trae la nueva versión de ASP.NET y otros sin embargo son mejoras y controles muy útiles.&lt;/p&gt;
&lt;p&gt;Os recomiendo que les echéis un vistazo, algunos pueden ser de mucha utilidad.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/dtax/aggbug/1342.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Leyendo el blog de <a href="http://weblogs.asp.net/cweyer/">Christian Weyer</a> he encontrado <a href="http://weblogs.asp.net/cweyer/archive/2005/03/18/395197.aspx">un post</a> muy interesante en el que hablaba de <a href="http://aspalliance.com/articleViewer.aspx?aId=652&amp;pId=2">un articulo de ASP Alliance</a> donde Jason N. Gaylord hace una magnífica recopilación de muchos controles y componentes para ASP.NET que son gratuitos. Muchos de ellos emulan algunas de las nuevas funcionalidades que nos trae la nueva versión de ASP.NET y otros sin embargo son mejoras y controles muy útiles.</p>
<p>Os recomiendo que les echéis un vistazo, algunos pueden ser de mucha utilidad.</p><img src ="http://blogs.clearscreen.com/dtax/aggbug/1342.aspx" width = "1" height = "1" /></body></item></channel></rss>