Writing log and screenshot in Cucumber Report html and cucumber JVM report.
Жүктеу.....
Пікірлер: 24
@rajeshkumarsharma81002 жыл бұрын
Thanks Niraj it worked for me....
@NirajGupta Жыл бұрын
with io.cucumber jar we have scenario.attach(screenshot, "image/png","first") for attaching screenshot for attaching text to scenario scenario.attach("Text key:", " text/plain"," Random String");
Hi Niraj, thanks for this amazing video, I have implemented this in the page object method level which works fine if I run single test but having issues when i run parallel execution, scenario.log is getting added to different scenario, how to resolve this?
@NirajGupta
3 жыл бұрын
Are you capturing the scenario name in global variable.use @After and use the global scenario and then log the logger
@mizanur968
3 жыл бұрын
yes, I have captured in public static Scenario sceanio; then initialize that in @before method as ClassName.scenario = scenaio. and also used in @after method as ClassName.scenario = scenario, then used in the pageObject methods as ClassName.scenario.write("bla bla"). Now when I execute in parallel, "bla bla" is getting added to the cucumber report but with incorrect scenario, did i make any mistak?
@NirajGupta
3 жыл бұрын
@@mizanur968 Are you using single tton framework...parallel execution work well when you are making single object for wriver through the test execution
@MrRanjitray3 жыл бұрын
Hi Niraj, Thanks a lot for a great video. I am using javascript. I want to implement the same kind of report. Current feature file text is getting reflected in the report. Wat to put the logger.info from the script message in the Report. Could you please help. ? Or can you create a video for this.
@sureshkumarsekar5156 Жыл бұрын
Showing this error - java.lang.NullPointerException: Cannot invoke "io.cucumber.java.Scenario.log(String)" because "apphooks.CommonStep.scenario" is null how to rectify it
@swagatikarath43992 жыл бұрын
After writing private static logger which package we are importing??
@NirajGupta
2 жыл бұрын
import org.apache.log4j.Logger;
@sanjeets933 жыл бұрын
Hi Niraj, Is there a way to upload screenshot for individual BDD steps in cucumber report.
@NirajGupta
3 жыл бұрын
Yes.You can embed the screen shot after each step finished. or you can use extend report also.Please check my extend report video. or you can use io.cucumber jar in place of info.cukes cucumber jar. check @Afterstep anotation
@dinesh406 Жыл бұрын
scenario. write() method not showing.. I mean no write method. Its showing getName() and wait() , attach() method its showing?
@NirajGupta
Жыл бұрын
Yes with io.cucumber jar we have scenario.attach(screenshot, "image/png","first") for attaching screenshot for attaching text to scenario scenario.attach("Text key:", " text/plain"," Random String");
scenario.write("") is not printing message from step defintion, its working from coomon steps
@shikharohilla4118
4 жыл бұрын
I am getting null pointer exception for scenario.write() from common steps and from step def also its not giving any exception but still not printing in report. could you please suggest
@NirajGupta
4 жыл бұрын
You need to pass scenario object from common step
@NirajGupta
4 жыл бұрын
first you should assign scenario object to public variable in commonstep and then refer that same variable in step.scenario.write("Hello cucumber ")
@diwakarkumar2758
4 жыл бұрын
Log4j we have to use or not
@NirajGupta
4 жыл бұрын
@@diwakarkumar2758 it's up to you .If you want to user logger for your debuging then use logger.else skip it
Пікірлер: 24
Thanks Niraj it worked for me....
with io.cucumber jar we have scenario.attach(screenshot, "image/png","first") for attaching screenshot for attaching text to scenario scenario.attach("Text key:", " text/plain"," Random String");
GIt Hub Url-github.com/callnirajgupta/ExtendsAndLogInCucumber/tree/master/SampleSeleniumProject
That's very helpful.
Hi Niraj, thanks for this amazing video, I have implemented this in the page object method level which works fine if I run single test but having issues when i run parallel execution, scenario.log is getting added to different scenario, how to resolve this?
@NirajGupta
3 жыл бұрын
Are you capturing the scenario name in global variable.use @After and use the global scenario and then log the logger
@mizanur968
3 жыл бұрын
yes, I have captured in public static Scenario sceanio; then initialize that in @before method as ClassName.scenario = scenaio. and also used in @after method as ClassName.scenario = scenario, then used in the pageObject methods as ClassName.scenario.write("bla bla"). Now when I execute in parallel, "bla bla" is getting added to the cucumber report but with incorrect scenario, did i make any mistak?
@NirajGupta
3 жыл бұрын
@@mizanur968 Are you using single tton framework...parallel execution work well when you are making single object for wriver through the test execution
Hi Niraj, Thanks a lot for a great video. I am using javascript. I want to implement the same kind of report. Current feature file text is getting reflected in the report. Wat to put the logger.info from the script message in the Report. Could you please help. ? Or can you create a video for this.
Showing this error - java.lang.NullPointerException: Cannot invoke "io.cucumber.java.Scenario.log(String)" because "apphooks.CommonStep.scenario" is null how to rectify it
After writing private static logger which package we are importing??
@NirajGupta
2 жыл бұрын
import org.apache.log4j.Logger;
Hi Niraj, Is there a way to upload screenshot for individual BDD steps in cucumber report.
@NirajGupta
3 жыл бұрын
Yes.You can embed the screen shot after each step finished. or you can use extend report also.Please check my extend report video. or you can use io.cucumber jar in place of info.cukes cucumber jar. check @Afterstep anotation
scenario. write() method not showing.. I mean no write method. Its showing getName() and wait() , attach() method its showing?
@NirajGupta
Жыл бұрын
Yes with io.cucumber jar we have scenario.attach(screenshot, "image/png","first") for attaching screenshot for attaching text to scenario scenario.attach("Text key:", " text/plain"," Random String");
Can you please share the above project.
@NirajGupta
4 жыл бұрын
github.com/callnirajgupta/ExtendsAndLogInCucumber/tree/master/SampleSeleniumProject
scenario.write("") is not printing message from step defintion, its working from coomon steps
@shikharohilla4118
4 жыл бұрын
I am getting null pointer exception for scenario.write() from common steps and from step def also its not giving any exception but still not printing in report. could you please suggest
@NirajGupta
4 жыл бұрын
You need to pass scenario object from common step
@NirajGupta
4 жыл бұрын
first you should assign scenario object to public variable in commonstep and then refer that same variable in step.scenario.write("Hello cucumber ")
@diwakarkumar2758
4 жыл бұрын
Log4j we have to use or not
@NirajGupta
4 жыл бұрын
@@diwakarkumar2758 it's up to you .If you want to user logger for your debuging then use logger.else skip it