SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

Extent Reporting Framework & Parallel Execution With SpecFlow - Report Scenarios Getting Logged Under The Last Executed Thread

Open ramgkn opened this issue 5 years ago • 10 comments

Hi Team,

I am in the process of enabling Parallel Execution for One of My Project; however ended up in a situation where I am able to execute test cases parallelly but the ExtentReport is generating wearied report - all the Test Steps are logged under the last scenario that got executed; where as i have executed 3 separate feature files.

Solution that i am working on along with sample report attached. Tired to workout on couple of solution suggested in google with no luck . Can somebody give me direction on this.

ExtentReport_Local.zip

ParallelExecution.zip

ramgkn avatar Nov 05 '19 08:11 ramgkn

Hi Team, I know support is quite busy; however, any direction that you can guide me with this issue.

ramgkn avatar Nov 07 '19 04:11 ramgkn

Guys.. any recommendations.

ramgkn avatar Nov 13 '19 06:11 ramgkn

I have also seen this behavior in parallel execution, but kind of living with it :( Would be nice if it gets fixed.

SavitaMaurya avatar Nov 26 '19 14:11 SavitaMaurya

Team,

Any recommendations.

ramgkn avatar Nov 27 '19 03:11 ramgkn

I've changed the title of this issue to reflect that you are having issues with Extent Reporting Framework (which is my understanding of the issue). Maybe that will attract more responses from others who have experience with Extent.

Stephen-Mc avatar Nov 29 '19 11:11 Stephen-Mc

Thanks Stephen....

I was able to sort the issue out to a certain extend... @SavitaMaurya - Try following the link https://stackoverflow.com/questions/54191960/extent-report-for-parallel-testing-xunit-and-specflow

"[ThreadStatic] private static ExtentTest scenario;"

Should do the trick for you as well.. may be with some cosmetic changes witin your hooks/listener class.

ramgkn avatar Nov 29 '19 12:11 ramgkn

@ramgkn [ThreadStatic] worked for me but now my steps are written to random scenarios in the report. Did you ever get this working correctly?

ChrisWoodMHM avatar Jul 16 '20 14:07 ChrisWoodMHM

At the end worked for me, it can be due to the context variables have not kept thread static.

Please check that , if still issue will give u a snippet for nunit

On Thu, 16 Jul, 2020, 19:38 ChrisWoodMHM, [email protected] wrote:

@ramgkn https://github.com/ramgkn [ThreadStatic] worked for me but now my steps are written to random scenarios in the report. Did you ever get this working correctly?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SpecFlowOSS/SpecFlow/issues/1768#issuecomment-659436875, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH4F22XLGCLHNN7X2A44JFLR34CWJANCNFSM4JI7LYSQ .

ramgkn avatar Jul 17 '20 04:07 ramgkn

Thanks Stephen....

I was able to sort the issue out to a certain extend... @SavitaMaurya - Try following the link https://stackoverflow.com/questions/54191960/extent-report-for-parallel-testing-xunit-and-specflow

"[ThreadStatic] private static ExtentTest scenario;"

Should do the trick for you as well.. may be with some cosmetic changes witin your hooks/listener class.

Thanks, I had the same issue and adding the [ThreadStaticAttribute] in the static ExtentTest, now the report works :)

mjsegovia avatar Dec 09 '20 12:12 mjsegovia

@ramgkn , I facing the same, but I in advanced stage, report is not generating for me. would you please share me the extent test part of the code, just wanted to understand how fearturecontext, scenario context are configured

shyam-nithyanandham avatar May 25 '22 15:05 shyam-nithyanandham