SpecResults icon indicating copy to clipboard operation
SpecResults copied to clipboard

Reporting crashes always

Open mlavigne1964 opened this issue 10 years ago • 3 comments

I'm trying to have the reporting module to works but to no avail.

I have my Step class derived from ReportingStepDefinitions I do have a [BeforeTestRun] method to setup the reporting. I'm using the minimum setup just to make it run: Reporters.Add( new PlainTextReporter() );

And yet, the second I run my test I get the error below. Any idea? someone?

Simple and fast scenarioSystem.NullReferenceException : Object reference not set to an instance of an object. TearDown : System.NullReferenceException : Object reference not set to an instance of an object.

Server stack trace: at SpecFlow.Reporting.Reporters.ExecuteStep(Action action, MethodBase methodBase, Object[] args) at SpecFlow.Reporting.ReportingMessageSink.SyncProcessMessage(IMessage msg) at System.Runtime.Remoting.Lifetime.LeaseSink.SyncProcessMessage(IMessage msg) at System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(IMessage reqMsg) at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(Object[] args) at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args) at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object[] args) at System.Threading.Thread.InternalCrossContextCallback(Context ctx, InternalCrossContextDelegate ftnToCall, Object[] args) at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(IMessage reqMsg)

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 GEOVIXEL.Cam360.Features.Support.ApplicationHooks.StartApplicationBeforeScenario() at lambda_method(Closure , IContextManager ) at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) at TechTalk.SpecFlow.Bindings.BindingInvokerExtensions.InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, IContextManager contextManager, ITestTracer testTracer) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType bindingEvent) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireScenarioEvents(HookType bindingEvent) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnScenarioStart(ScenarioInfo scenarioInfo) at TechTalk.SpecFlow.TestRunner.OnScenarioStart(ScenarioInfo scenarioInfo) at GEOVIXEL.Cam360.Features.Features.TestASpecFlowFeatureFeature.ScenarioSetup(ScenarioInfo scenarioInfo) in E:\MLavigne\My Devlop\GEOVIXEL\Research\Cam360\GEOVIXEL.Cam360.Features\Features\QuickFeature.feature.cs:line 0 at GEOVIXEL.Cam360.Features.Features.TestASpecFlowFeatureFeature.SimpleAndFastScenario() in E:\MLavigne\My Devlop\GEOVIXEL\Research\Cam360\GEOVIXEL.Cam360.Features\Features\QuickFeature.feature:line 7 --TearDown

Server stack trace: at SpecFlow.Reporting.Reporters.ExecuteStep(Action action, MethodBase methodBase, Object[] args) at SpecFlow.Reporting.ReportingMessageSink.SyncProcessMessage(IMessage msg) at System.Runtime.Remoting.Lifetime.LeaseSink.SyncProcessMessage(IMessage msg) at System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(IMessage reqMsg) at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(Object[] args) at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args) at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object[] args) at System.Threading.Thread.InternalCrossContextCallback(Context ctx, InternalCrossContextDelegate ftnToCall, Object[] args) at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(IMessage reqMsg)

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 GEOVIXEL.Cam360.Features.Support.ApplicationHooks.CloseApplicationAfterScenario() at lambda_method(Closure , IContextManager ) at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) at TechTalk.SpecFlow.Bindings.BindingInvokerExtensions.InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, IContextManager contextManager, ITestTracer testTracer) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType bindingEvent) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireScenarioEvents(HookType bindingEvent) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnScenarioEnd() at TechTalk.SpecFlow.TestRunner.OnScenarioEnd() at GEOVIXEL.Cam360.Features.Features.TestASpecFlowFeatureFeature.ScenarioTearDown() in E:\MLavigne\My Devlop\GEOVIXEL\Research\Cam360\GEOVIXEL.Cam360.Features\Features\QuickFeature.feature.cs:line 0

mlavigne1964 avatar Jan 30 '15 15:01 mlavigne1964

It seems like the internal TearDown is being counted as a step of our tests, but it's never assigned to any reporter (I'm using webapp). It's also an issue for these types of steps that don't belong to the test, if you have implemented the screenshot per step like the showcase sample, because some steps won't have access to the browser. I still don't have a PR for this, but I noticed the changes I've made in my repo have fix this issue (but created others).

MilkyWayJoe avatar Apr 09 '15 14:04 MilkyWayJoe

any updates on this issue?

shuai-zh avatar Jul 10 '15 20:07 shuai-zh

any updates? I'm having the same issue

kirill-a avatar Sep 15 '15 13:09 kirill-a