How can I get the screenshot file name which is auto created using "Verify" activities?

How can I get the screenshot file name which is auto created using “Verify” activities? These screenshots are taken by activities like “Verify Control Attribute, Verify Expression, Verify Expression with Operator”. There is property like TakeScreenshotifFailed & TakeScreenshotifSucceeded for verify activities, & we can set the folder path, but the file name is randomly selected by UiPath, I want that file name So, I can use screenshot file to create custom report. I could see the file name in Logs, But not sure how can I grab it in variable name. Please help.

@jadhavsiddh

use this to get latest file of the screenshots folder, this will give you the file name you need

new DirectoryInfo("screenshotFolderPath").GetFiles().OrderByDescending(Function(f) f.LastWriteTime).First().ToString
1 Like

Hi Jack,
Yes, Its the way, to fetch out the latest file from the folder. Thanks for that. I assume, since I could see file name in logs, there has to be some other & direct way to get this file name.
Though, appreciate your response. Thanks again.

Regards,
Siddhesh Jadhav

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.