I am learning watin and Nunit by experimenting the sample and their site.
Getting Started with watin
Using VS2010, I Create a Class library in my project,add reference to watin and nunit framework.I then installed Nunit GUI.I built my class library.Open the GUi open new project on the file menu and browse to location of the dll of the class library. When i run the class(dll) i received the error:
Volotrust_watin.Class1.Start_google:
System.IO.FileNotFoundException : Could not load file or assembly ‘Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db7cfd3acb5ad44e’ or one of its dependencies. The system cannot find the file specified.
here is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WatiN.Core;
using NUnit.Framework;
namespace Volotrust_watin
{
[TestFixture]
[RequiresSTA]
public class Class1
{
[Test]
public void Start_google()
{
using (var browser = new IE("www.google.com"))
{
browser.TextField(Find.ByName("q")).TypeText("watin");
browser.Button(Find.ByName("btnG")).Click();
Assert.IsTrue(browser.ContainsText("watin"));
}
}
}
}
I finally resolved my problem by removing the Interop.SHDocVw.dll from my project.