Hi,
I have been using ReportFullPageScreenshot library and able to capture the full page screenshot as expected. But I need to know where this .png file is being saved to perform some operations.
For example , Text file libraries will be saved to "Output" folder. Similarly I need the file path of this screenshot file. Below is the user code.
Could you please help at the earliest.
# Code
public static void ReportFullPageScreenshot(RepoItemInfo repoItemInfo)
{
ProgressForm.Hide();
try
{
Utils.CheckArgumentNotNull(repoItemInfo, "repoItemInfo");
var webDocument = repoItemInfo.CreateAdapter<WebDocument>(false);
if (webDocument == null)
{
Report.Error("Repository item '" + repoItemInfo.FullName + "' is not a web document. " +
"Screenshot can be taken only for web documents.");
return;
}
var screenshotFilePath = Path.GetTempFileName();
var screenshot = webDocument.CaptureFullPageScreenshot();
screenshot.Save(screenshotFilePath);
Report.LogData(ReportLevel.Info, "Screenshot", screenshot);
if (File.Exists(screenshotFilePath))
{
try
{
File.Delete(screenshotFilePath);
}
catch
{
// No need to handle exception.
// Temp files are deleted only to prevent piling up of unnecessary files.
}
}
}
catch (Exception ex)
{
Utils.ReportException(ex, libraryName);
}
ProgressForm.Show();
}
Require file path of the ReportFullPageScreenshot library
-
- Posts: 22
- Joined: Fri Jun 04, 2021 4:53 pm
Re: Require file path of the ReportFullPageScreenshot library
Hi Akhil.pokala,
By default, images are stored in "\<ProjectName>\bin\Debug\Reports\images_<TestSuiteName>_<8 character Hex string>"
I hope this helps!
--Jacob
By default, images are stored in "\<ProjectName>\bin\Debug\Reports\images_<TestSuiteName>_<8 character Hex string>"
I hope this helps!
--Jacob
-
- Posts: 22
- Joined: Fri Jun 04, 2021 4:53 pm