【问题标题】:Unit Test Adapter threw exception: Object must implement IConvertible..in BDD specflow framework单元测试适配器抛出异常:对象必须在 BDD 规范流框架中实现 IConvertible..
【发布时间】:2015-06-12 06:48:47
【问题描述】:

我是自动化测试和开发基于 specflow 的框架以测试基于 CRM 的应用程序的新手。

我必须在 Chrome 浏览器上测试应用程序,并且我正在创建如下变量来访问浏览器:

protected readonly var Browser =  BrChrome;

protected static var BrChrome
{
    get { return Connect.Sys["Browser"]("chrome"); }
}

然后使用这个 BrChrome 我将访问其他网页对象(使用 AssertObjectPresent),将其视为父对象。

当我在 Visual Studio 中运行测试时,出现以下错误:

"Unit Test Adapter threw exception: 
Object must implement IConvertible....."

在调试时,我在上面声明 Chrome 浏览器的代码处遇到异常。

System.Exception was unhandled by user code
   Message=Cannot create ActiveX component.
   Source=Microsoft.VisualBasic

   StackTrace:
    at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName)
    at AutomatedQA.script.var.GetObjectAlternative(String Name, String AlternativeName)
    at AutomatedQA.TestComplete.Connect.TBaseTCClass.GetTestCompleteIntegration()
    at AutomatedQA.TestComplete.Connect.TBaseTCClass.GetTestCompleteObjectByName(String Name)
    at AutomatedQA.TestComplete.Connect.SysClass.Init()
    at AutomatedQA.script.var.get_Item(String name, var[] args)
    at X.Y.TestAutomation.Utility.TestCompleteMethods.get_BrChrome() in F:\Visual Studio 2010\Projects\X.Y.Automation\Barclays.OneEvent.TestAutomation.Utility\TestCompleteMethods.cs:line 43
    at X.Y.TestAutomation.Utility.TestCompleteMethods..ctor() in F:\Visual Studio 2010\Projects\X.Y.Automation\X.Y.TestAutomation.Utility\TestCompleteMethods.cs:line 33     
    at X.Y.TestAutomation.Utility.Env..ctor()
    at X.Y.TestAutomation.OneEventHooks.BeforeFeature() in F:\Visual Studio 2010\Projects\X.Y.Automation\X.Y.Automation\YHooks.cs:line 28
    at lambda_method(Closure , IContextManager )

  InnerException:"

【问题讨论】:

  • 我删除了 Specflow 标签,因为这与我不相信的 specflow 无关。
  • 我删除了第一行代码,它工作正常。
  • @pratikshajain 如果它现在有效,请确保您添加对您的问题的答案以帮助其他人解决相同的问题,或者如果这只是一个简单的错误,请删除您的问题。
  • 不,问题仍然存在..我仍然面临异常。
  • 问题出在参考文件上。我为 Testcomplete 添加的参考文件是 9.35 版本,而我应该选择与已安装 testcomplete 相同版本的参考文件,即 V10.4

标签: c# dynamics-crm bdd


【解决方案1】:

当我在具有测试代理 VS2012 版本的机器上安装 VS 2015 后运行分布式编码 ui 测试时,我收到了相同的错误消息“单元测试适配器抛出异常:对象必须实现 IConvertible”。重新安装Test agent VS2012后错误消失。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-18
    • 1970-01-01
    • 1970-01-01
    • 2016-01-17
    • 2014-04-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多