Screenshot
The Screenshot
class lets you include images in your report. It supports multiple input formats — Base64 strings, raw byte arrays, and file paths—making it flexible. Each factory method (FromBase64, FromBytes, and FromFile) includes built-in validation to ensure consistent rendering and prevent malformed inputs. Optional title can be attached to screenshots for semantic clarity.
Screenshot Conversion
You can convert selenium native screenshot output into a TrganReport Screenshot object using one of the following methods,
1 2 3 4 5 6 7 8 9 10 11 |
|
Tip
In version 1.0.0, screenshots generated via Screenshot.FromBase64() may result in slightly larger file sizes compared to the other two methods. This is because no image optimization is applied, and the image is rendered at full original quality. For finer control over image compression and reduced file size, consider using Screenshot.FromBytes() instead.