Reputation: 51
Beforefeature ---
ExtentTest feature = extentReports.CreateTest<Feature>("Name of Feature");
Before Scenario
ExtentTest scenario = feature.CreateNode<Scenario>("Name of Scenario");
Scenario name and feature name are being pulled dynamically by using following properties from REQNROLL.
FeatureContext.FeatureInfo.Title
and ScenarioContext.ScenarioInfo.Title
Issue --- After the control moves from BEFOREFEATURE to BEFORESCENARIO , the value of feature variable is null inspite of this variable being defined at a class level as private static as mentioned below
[ThreadStatic]
private static ExtentTest feature;
[ThreadStatic]
private static ExtentTest scenario;
Note:- I had been running my tests in parallel at a fixture level using specflow hence had to use the ThreadStatic attribute.
If I do not use the [ThreadStatic] attribute I am not seeing this issue in REQNROLL. The same code works in specflow however on using it in REQNROLL I get null object reference error in BEFORESCENARIO
Any suggestions/idea for this issue.
Upvotes: 0
Views: 46