For those who don't know what WatiN does then look at the following code:
[Test]
public void SearchForWatiNOnGoofle()
{
using(IE 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"));
}
}
Within the class add a reference to WatiN.Core.dll and Nutit.framework.dll and then run this little test app. What will happen is a new instance of IE will spin up [other browsers can be run if necessary using further references]. It will search teh page for the textbox with the name 'q' and enter the text 'WatiN'. It will then find the button called 'btnG' and click it.
Read more: DevOps zone
QR: