【发布时间】:2012-07-16 15:49:16
【问题描述】:
我正在通过试验样本及其网站来学习 watin 和 Nunit。
Getting Started with watin
使用VS2010,我在我的项目中创建一个类库,添加对watin和nunit框架的引用。然后我安装了Nunit GUI。我构建了我的类库。在文件菜单上打开GUI打开新项目并浏览到dll的位置类库。当我运行类(dll)时,我收到了错误:
Volotrust_watin.Class1.Start_google:
System.IO.FileNotFoundException:无法加载文件或程序集“Interop.SHDocVw,版本=1.1.0.0,文化=中性,PublicKeyToken=db7cfd3acb5ad44e”或其依赖项之一。系统找不到指定的文件。
这是我的代码:
使用系统;
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"));
}
}
}
}
【问题讨论】: