2

In visual studio 2019, I can build and run my specific test cases perfectly in test explorer. But I run from command line, its showing below error.

Discovered 1 tests
Thread#0: The argument type 'System.MarshalByRefObject' cannot be converted into parameter type 'TechTalk.SpecRun.Commo
Thread#1:
Thread#2:
100% (1/1) completed

Done.
TechTalk.SpecRun.Framework.SpecRunException: At least one test thread aborted. ---> System.Runtime.Remoting.RemotingException: The argument type 'System.MarshalByRefObject' cannot be converted into parameter type 'TechTalk.SpecRun.Common.Logging.ITestLogger'. ---> System.InvalidCastException: Object must implement IConvertible.
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt)
   --- End of inner exception stack trace ---

Server stack trace:
   at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt)
   at System.Runtime.Remoting.Messaging.Message.CoerceArgs(MethodBase mb, Object[] args, ParameterInfo[] pi)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at TechTalk.SpecRun.Framework.ITestAssemblyExecutor.Initialize(Int32 threadId, ITestExecutionManager executionManager, IAssemblyReference assemblyReference, ITestLogger logger, String testAssemblyFullPath, String testAssemblyConfigFilePath, TestExecutionConfiguration testExecutionConfiguration)
   at TechTalk.SpecRun.Framework.TestThread.InitializeTestThreadExecutor(IAssemblyReference testAssembly, ExecutionModelSettings executionModelSettings, String testTarget)
   at TechTalk.SpecRun.Framework.TestThread.GetThreadExecutorFor(TestItem testItem)
   at TechTalk.SpecRun.Framework.TestThread.Run(ITestExecutionManager executionManagerForRun)
   at TechTalk.SpecRun.Framework.AsyncTestThreadRunner.RunSync(TestExecutionManager executionManager)
   --- End of inner exception stack trace ---
Result: test framework error: At least one test thread aborted.
  Total: 1
  Succeeded: 0
  Ignored: 0
  Pending: 0
  Skipped: 1
  Failed: 0

version I'm using:

  • .NET Framework : 4.6.2
  • SpecFlow : 2.2.1
  • SpecRun.Runner : 1.6.3
  • SpecRun.SpecFlow : 1.6.3
  • SpecRun.SpecFlow.2-2-0 : 1.6.3

command:

SpecRun.exe run Default.srprofile /basefolder:C:\Development\Project\bin\Debug\Automation\TestAutomation.Specs\ /outputfolder:output /filter:"testpath:Scenario:Search+page+in+Automation"

How can I fix this issue?

Nijandhan
  • 185
  • 1
  • 11

1 Answers1

2


It is an active SpecFlow bug:
https://github.com/SpecFlowOSS/SpecFlow/issues/1443

Best regards,
PM

Piotr M.
  • 385
  • 2
  • 8
  • 1
    I use VsTest instead of SpecRun.exe – Piotr M. Aug 17 '21 at 09:09
  • Yes Piotr, I tried that VsTest too. For my case, I have to execute particular scenario test cases. I used /tests property and its running all test cases which have the substring of given scenario name. Example: if suppose I need to execute "n1.n2.Add" (/tests:"n1.n2.Add") , its running test cases which contains "A.n2.Add", "n1.n2.Sub". Also, I'm trying to get test cases name in run time from trx file, so I can't use TestCategory because we don't know the category at that time. Even I tried with FullyQualifiedName, its showing no test cases found even it is available. Any suggestion? – Nijandhan Aug 18 '21 at 05:14
  • FYI @Piotr M. In app.config, I have used specrun as unit test provider. `` – Nijandhan Aug 18 '21 at 05:20