【问题标题】:Running Unit test using Nunit GUI使用 Nunit GUI 运行单元测试
【发布时间】: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"));

} 
}
}
} 

【问题讨论】:

    标签: nunit watin


    【解决方案1】:

    我终于通过从我的项目中删除 Interop.SHDocVw.dll 解决了我的问题。

    【讨论】:

      猜你喜欢
      • 2015-06-03
      • 2013-02-09
      • 1970-01-01
      • 2012-03-26
      • 2020-11-07
      • 2011-02-20
      • 1970-01-01
      • 1970-01-01
      • 2017-04-04
      相关资源
      最近更新 更多