Does anyone have successfully setup a beforetestrun/aftertestrun hook when using Specflow runner on multithread using AppDomain I saw some answer from this thread - Run BeforeTestRun and AfterTestRun only once using specflow with Selenium
Unfortunately, I'm having difficulty to set this up as we need it to configure our TestRail integration.
It is possible - you have to use a kernel-based lock (the following constructor is the one to use): https://learn.microsoft.com/en-us/dotnet/api/system.threading.semaphore.-ctor?view=net-5.0#System_Threading_Semaphore__ctor_System_Int32_System_Int32_System_String_System_Boolean__
The flow:
Best regards, PM