extentreports-csharp
extentreports-csharp copied to clipboard
Relative Screenshot file path
Hello Im using ExtenXreporter and HtmlReporter at the same time. Because we have CI and tests results will be copied after test run to another location, i need put relative screenshot path and do this by this way "..\..\TestOutput\Screenshots\screenshot.png" but this way doesnt work for ExtentX because it need full file path to upload screenshot. Do you have any idea how to avoid the issue?
ExtentX will not use this path, the API uploads the image to the server and a new path is built. The ExtentX path generally looks like:
uploads/59246932ecae471d984cb24c/59246935ecae471d984cb265/image-name.png
Yeah, I khow. But could you please refactor AddScreenshot method to accept relative and absolute path at the same time. Or it can detect which path specified. If path is relative then for HtmlReporter it uses relative path but for ExtentXReporter it should be converted to absoulute path.