Unit Test Adapter threw exception: Object must implement IConvertible..in BDD specflow framework

847 views Asked by At

I am new to Automation testing and developing specflow based framework for testing CRM based application.

I have to test the application on Chrome browser and I am creating a variable as below to aceess the browser:

protected readonly var Browser =  BrChrome;

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

Then using this BrChrome I would acess other web page objects (using AssertObjectPresent) considering this as parent object.

When I am running the test in Visusual Studio, I am getting the below Error:

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

While Debug I am getting Exception at above code where Chrome browser is declared.

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:"
1

There are 1 answers

0
Mike Shapiro On

I've got the same error message "Unit Test Adapter threw exception: Object must implement IConvertible" when I run distributed coded ui test after installation VS 2015 on machine that had Test Agent VS2012 version. The error disappeared after I reinstall Test agent VS2012.