How to attach screenshot in cucumber-html report | How to embed screenshot in Cucumber JVM report |

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

ความคิดเห็น • 14

  • @SanjeewaGunarathna-sr2kn
    @SanjeewaGunarathna-sr2kn ปีที่แล้ว +1

    Wow Thanks Brother 👌👌👌👌

  • @Al-oh9yr
    @Al-oh9yr 2 ปีที่แล้ว +1

    Hi Sir this image is in png. How do we use base 64 image as everyone can see tge screenshot in report?

  • @pavankl2518
    @pavankl2518 ปีที่แล้ว +1

    How can i print or log the statements in report at any step or at any method

    • @virenautomationtesting
      @virenautomationtesting  ปีที่แล้ว

      Hi Pavan ...steps are already printed or logged in report..
      Please provide more info about your requirements then I can help you accordingly

  • @kangappan198
    @kangappan198 ปีที่แล้ว +1

    Hi
    Once the test suite is completed, how to clear the test result. please help me with this

    • @virenautomationtesting
      @virenautomationtesting  ปีที่แล้ว

      Hi thanks for your questions.
      You need to run with mvn clean verify command to clean results in target folder .
      Or where do you generated your test results?

  • @Al-oh9yr
    @Al-oh9yr 2 ปีที่แล้ว +1

    And how do we share the report, as I can see that the report path is your local. Any help will be highly appreciated

  • @BalajiSubramanian-f5o
    @BalajiSubramanian-f5o 11 หลายเดือนก่อน +1

    Hi, it's working, The Screenshot can able to downloaded. But it's not display in the report. Its shows only "This file cannot be displayed. Use download button to get the content as file." How to I resolve this

    • @virenautomationtesting
      @virenautomationtesting  11 หลายเดือนก่อน

      Please share error screenshot and pipeline you have created?
      Did you follow same steps as I mentioned?

  • @srinivasjonnakuti9344
    @srinivasjonnakuti9344 2 ปีที่แล้ว +1

    The screenshot attached only after the last step execution. Please help me . i wrote like this.@After(order = 2)
    public void tearDown(io.cucumber.java.Scenario scenario) {
    if (scenario.isFailed()) {
    String screenShotName = scenario.getName().replaceAll(" ", "_");
    byte[] sourcePath = ((TakesScreenshot)getDriver()).getScreenshotAs(OutputType.BYTES);
    scenario.attach(sourcePath, "image/png", screenShotName);
    }else {
    String screenShotName = scenario.getName().replaceAll(" ", "_ PASS _ ");
    byte[] sourcePath = ((TakesScreenshot)getDriver()).getScreenshotAs(OutputType.BYTES);
    scenario.attach(sourcePath, "image/png", screenShotName);
    }
    }

    • @virenautomationtesting
      @virenautomationtesting  2 ปีที่แล้ว

      Hi Srinivas ,
      This is BDD framework behaviour that we can take screenshot once scenario is completed not at each step level .
      In above code ,you are taking scenario.failed() that means it's scenario based screenshot behaviour not at each step level .so whenever your scenario passed of failed you can capture screenshot.better take screenshot for passed scenarios also .
      Let me know for any updates