Reputation: 51
We are having extent reports for reporting. There's already a hooks class for extent reports which , the reports run good if they are scheduled sequentially. But if the test scenarios are executed parallel , the report doesn't generate. Is there anyway i could use the same hooks class for both parallel and sequential execution. If yes, how.
Upvotes: 1
Views: 1993
Reputation: 172
Use the [ThreadStatic]
attribute to your extent report fields in Hooks call. It gives you the thread specific variable and you will get the correct report.
[ThreadStatic]
private static ExtentTest scenario;
Upvotes: 4