【问题标题】:Error 1 'NUnit.Framework.TestCase' is not an attribute class错误 1 ​​'NUnit.Framework.TestCase' 不是属性类
【发布时间】:2013-10-05 20:16:10
【问题描述】:

.....

    [NUnit.Framework.TestCase**("Chrome", TestName = "One")]
    [NUnit.Framework.TestCase(" Firefox", TestName = "Two")]
    [NUnit.Framework.TestCase("InternetExplorer", TestName = "Three")]
    public void TheRegisterTest(IWebDriver driver)
    {
        driver.Navigate().GoToUrl(baseURL + "/mercurywelcome.php");

.....

当我尝试构建解决方案时,我收到如下所示的错误:

NUnit.Framework.TestCase' is not an attribute class

我正在使用以下名称空间:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;

【问题讨论】:

    标签: nunit testcase


    【解决方案1】:

    您通过指定完整的命名空间引用了错误的类。

    写下你的台词

    [NUnit.Framework.TestCase(...
    

    喜欢这个

    [TestCase(...
    

    【讨论】:

      【解决方案2】:

      即使按照 Dio F 的建议,我也遇到了错误

      [TestCase(...
      

      原来我安装了旧版本的 NUnit。安装版本 2.6.2 修复了它。

      【讨论】:

        猜你喜欢
        • 2020-12-24
        • 2016-04-16
        • 2021-05-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-06-12
        • 1970-01-01
        • 2018-01-29
        相关资源
        最近更新 更多