Skip to content
Advertisement

Java cucumber Selenium : NullPointerException for scenario.write for the first scenario on before tag

I am getting the NullPointerException when the code below code is executed. Note that the exception is recieved only for the first cucumber scenario executed. There is no exception for the second scenario. I am actually trying to insert the timestamp before start of each scenario. Please advise how this issue can be fixed. Any help will be appreciated.

JavaScript

I tried this as well, but the same error.

JavaScript

Advertisement

Answer

Was unable to find a direct answer. However As an alternative : i avoided writing on “scenario” in @Before

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement