WatIN

From Logic Wiki
Jump to: navigation, search


WatiN Overview

WatIN aims to bring you an easy way to automate your tests with Internet Explorer and FireFox using .Net.

WatiN Example

Following is the Hello world example of web test automation: searching Google.

[Test] 
public void SearchForWatiNOnGoogle() 
{
  using (var browser = new IE("http://www.google.com"))
  {
    browser.TextField(Find.ByName("q")).TypeText("WatiN");
    browser.Button(Find.ByName("btnG")).Click();
  
    Assert.IsTrue(browser.ContainsText("WatiN"));
  }
}

Installation

PM> Install-Package WatiN