2

在 Visual Studio 2019 中,我可以在测试资源管理器中完美地构建和运行我的特定测试用例。但是我从命令行运行,它显示以下错误。

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

我正在使用的版本:

  • .NET 框架:4.6.2
  • 规范流:2.2.1
  • SpecRun.Runner:1.6.3
  • SpecRun.SpecFlow:1.6.3
  • SpecRun.SpecFlow.2-2-0:1.6.3

命令:

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

我该如何解决这个问题?

4

1 回答 1

2


这是一个活跃的 SpecFlow 错误:
https ://github.com/SpecFlowOSS/SpecFlow/issues/1443

最好的问候,
PM

于 2021-08-16T09:12:14.263 回答