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?
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?
@@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.
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
Showing this error - java.lang.NullPointerException: Cannot invoke "io.cucumber.java.Scenario.log(String)" because "apphooks.CommonStep.scenario" is null how to rectify it
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
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");
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?
Are you capturing the scenario name in global variable.use @After and use the global scenario and then log the logger
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?
@@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.
Hi Niraj,
Is there a way to upload screenshot for individual BDD steps in cucumber report.
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
After writing private static logger which package we are importing??
import org.apache.log4j.Logger;
Showing this error - java.lang.NullPointerException: Cannot invoke "io.cucumber.java.Scenario.log(String)" because "apphooks.CommonStep.scenario" is null how to rectify it
Can you please share the above project.
github.com/callnirajgupta/ExtendsAndLogInCucumber/tree/master/SampleSeleniumProject
scenario.write("") is not printing message from step defintion, its working from coomon steps
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
You need to pass scenario object from common step
first you should assign scenario object to public variable in commonstep and then refer that same variable in step.scenario.write("Hello cucumber
")
Log4j we have to use or not
@@diwakarkumar2758 it's up to you .If you want to user logger for your debuging then use logger.else skip it
scenario. write() method not showing..
I mean no write method. Its showing getName() and wait() , attach() method its showing?
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");