extent-framework / extentreports-csharp

Extent Reporting Library, .NET
http://extentreports.com
Apache License 2.0
49 stars 40 forks source link

Object reference exception in RazorEngine when running scenarios in Scenario Outline - Extent Reports 5.0.1 #202

Closed ben-morris2 closed 7 months ago

ben-morris2 commented 8 months ago

I've noticed that in Extent Reports 5.0.1, if you run scenarios that use Scenario Outline Examples, the report fails to generate when .Flush() is called. The exception doesn't throw when you run tests normally, just in debug, but the report does not generate. When I run this in debug, it seems to be throwing an exception in the TemplateBase.cs class of the RazorEngine.Templating namespace. This doesn't happen when you run a test that is not contained with an Example. I've attached an image of the exception below. If anything else is needed please let me know!

OS: Windows 10 .NET Framework: .NET 6.0

image

anshooarora commented 7 months ago

@ben-morris2 I tried to repro and do observe an issue here, although I wasn't able to exactly see the issue you've referenced here. I'm adding a fix, hopefully that resolves what you're experiencing as well, but if it doesn't, an example or code snippet would really help.