No video

Writing log and screenshot in Cucumber Report

Writing log and screenshot in Cucumber Report html and cucumber JVM report.

Пікірлер: 24

  • @rajeshkumarsharma8100
    @rajeshkumarsharma81002 жыл бұрын

    Thanks Niraj it worked for me....

  • @NirajGupta
    @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");

  • @NirajGupta
    @NirajGupta4 жыл бұрын

    GIt Hub Url-github.com/callnirajgupta/ExtendsAndLogInCucumber/tree/master/SampleSeleniumProject

  • @TestersDiary
    @TestersDiary3 жыл бұрын

    That's very helpful.

  • @mizanur968
    @mizanur9683 жыл бұрын

    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

    @NirajGupta

    3 жыл бұрын

    Are you capturing the scenario name in global variable.use @After and use the global scenario and then log the logger

  • @mizanur968

    @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

    @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

  • @MrRanjitray
    @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
    @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

  • @swagatikarath4399
    @swagatikarath43992 жыл бұрын

    After writing private static logger which package we are importing??

  • @NirajGupta

    @NirajGupta

    2 жыл бұрын

    import org.apache.log4j.Logger;

  • @sanjeets93
    @sanjeets933 жыл бұрын

    Hi Niraj, Is there a way to upload screenshot for individual BDD steps in cucumber report.

  • @NirajGupta

    @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
    @dinesh406 Жыл бұрын

    scenario. write() method not showing.. I mean no write method. Its showing getName() and wait() , attach() method its showing?

  • @NirajGupta

    @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");

  • @therawscholar
    @therawscholar4 жыл бұрын

    Can you please share the above project.

  • @NirajGupta

    @NirajGupta

    4 жыл бұрын

    github.com/callnirajgupta/ExtendsAndLogInCucumber/tree/master/SampleSeleniumProject

  • @shikharohilla4118
    @shikharohilla41184 жыл бұрын

    scenario.write("") is not printing message from step defintion, its working from coomon steps

  • @shikharohilla4118

    @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

    @NirajGupta

    4 жыл бұрын

    You need to pass scenario object from common step

  • @NirajGupta

    @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

    @diwakarkumar2758

    4 жыл бұрын

    Log4j we have to use or not

  • @NirajGupta

    @NirajGupta

    4 жыл бұрын

    @@diwakarkumar2758 it's up to you .If you want to user logger for your debuging then use logger.else skip it