1
votes

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.

1
We are working on a specflow adapter which will be soon available allowing both sequential and parallel execution. Note: this would be version 4 only.foursyth

1 Answers

4
votes

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;