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?
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
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); } }
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
Wow Thanks Brother 👌👌👌👌
Welcome dude 😄
Hi Sir this image is in png. How do we use base 64 image as everyone can see tge screenshot in report?
How can i print or log the statements in report at any step or at any method
Hi Pavan ...steps are already printed or logged in report..
Please provide more info about your requirements then I can help you accordingly
Hi
Once the test suite is completed, how to clear the test result. please help me with this
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?
And how do we share the report, as I can see that the report path is your local. Any help will be highly appreciated
hi AI , covering this in new video.. uploading soon
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
Please share error screenshot and pipeline you have created?
Did you follow same steps as I mentioned?
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);
}
}
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