extentreports-csharp icon indicating copy to clipboard operation
extentreports-csharp copied to clipboard

Relative Screenshot file path

Open TheXby opened this issue 7 years ago • 2 comments

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?

TheXby avatar Jun 20 '17 13:06 TheXby

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

anshooarora avatar Jul 18 '17 00:07 anshooarora

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.

TheXby avatar Jul 18 '17 06:07 TheXby