Closed Fergal-C closed 1 year ago
Can you check the HTML on the report for the image path using devtools? Try using "extent.png" directly?
Thanks anshooarora,
This is the image html from the report in dev tools:
<img data-featherlight="./extent.png" src="./extent.png">
When the code is changed to:
test.Fail("Screenshot", MediaEntityBuilder.CreateScreenCaptureFromPath("extent.png").Build());
The img html from the report in DevTools changes to
<img data-featherlight="extent.png" src="extent.png">
But the image still does not load.
I also can't find the image locally, when I search for it in File Explorer, it seems like it is not being created.
This method will not capture a screenshot, but merely create the relevant link to the report given the path.
Thanks very much again anshooarora, that's exactly what I was misunderstanding. All working now.
Windows NET version 7.0.10 Extent Reports 5.0.0
I am using the following code to generate a screenshot for a failed test, but no image is actually being created in the test report:
test.Fail("Screenshot", MediaEntityBuilder.CreateScreenCaptureFromPath("." + @"/extent.png").Build());
The file path, from the broken image, appears correct "Reports/2023/12Sep/extent.png", where the report is stored in "Reports/2023/12Sep/"
Is there a known reason why the screenshot image is not created?
(Apologies if this is not an appropriate place for this question.)