单元测试适配器引发异常:对象必须实现 IConvertible.in BDD 规范流框架



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

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

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

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

当我在 Visusual 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 2010ProjectsX.Y.AutomationBarclays.OneEvent.TestAutomation.UtilityTestCompleteMethods.cs:line 43
    at X.Y.TestAutomation.Utility.TestCompleteMethods..ctor() in F:Visual Studio 2010ProjectsX.Y.AutomationX.Y.TestAutomation.UtilityTestCompleteMethods.cs:line 33     
    at X.Y.TestAutomation.Utility.Env..ctor()
    at X.Y.TestAutomation.OneEventHooks.BeforeFeature() in F:Visual Studio 2010ProjectsX.Y.AutomationX.Y.AutomationYHooks.cs:line 28
    at lambda_method(Closure , IContextManager )
  InnerException:"
当我

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

最新更新