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

Поділитися
Вставка
  • Опубліковано 17 гру 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

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

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

  • @BalajiSubramanian-f5o
    @BalajiSubramanian-f5o Рік тому +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  Рік тому

      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