anshooarora / extentreports-csharp

Community version of Extent API for .NET has moved to https://github.com/extent-framework/
http://extentreports.com/
Other
47 stars 43 forks source link

Images attached to extent report are not displayed in 3.0 #67

Closed sivadeepti closed 7 years ago

sivadeepti commented 7 years ago

I am trying to attach images to my report in my project.

Code:

test.AddScreenCaptureFromPath(@"C:\Users\Public\Pictures\Sample Pictures\Desert.jpeg", "Snapshot below:");

where test is an instance of Extent test.

Please let me know if am missing any thing. error

TheXby commented 7 years ago

nothing else. Maybe problem with permissions access to the file?! Try using another file in another folder. For my case im using as filepath $"..\\..\\{BaseConfiguration.ScreenShotFolder}\\{Path.GetFileName(DriverContext.ScreenshotFilePath)}" and it works fine. Absolute path also works fine.

sivadeepti commented 7 years ago

Yeah problem solved.

Used relative paths in the code. AddScreenCaptureFromPath takes relative path (relative to Screenshots folder wherever you save in your system)