Hi Alex,
For this scenario,, I would suggest creating a custom business object to capture screenshot. You can follow the below steps:
1) First create a business object named '
Utility-Screenshots' and the in the page description stage of the '
Initialise' action, add the below dependencies and namespaces under the '
Code Options' tab while selecting the language as '
Visual Basic':
Now, create a new action called '
Take Screenshot' with two input parameters called '
Screenshot Folder Path' (Text) and
Screenshot File Name' (Text) as shown below:
Add the code stage as shown above and use the below input parameters and code. No output parameter as such is required :
The code is as follows:
' Initialize variables
Dim bounds As Rectangle
Dim screenshot As System.Drawing.Bitmap
Dim graph As Graphics
'Set screen related parameters
bounds = Screen.PrimaryScreen.Bounds
screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb)
'Generate screenshot
graph = Graphics.FromImage(screenshot)
graph.CopyFromScreen(0, 0, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
'Save Screenshot
screenshot.Save(Screenshot_Folder_Path+"\"+Screenshot_File_Name)
screenshot.Dispose
Test Results:
From the process studio, you can easily invoke this action whenever you are in the unhappy path from you 'Recover' and 'Resume' stage and once the screenshot has been saved at the given file path, you can use either 'SMTP/POP3' or Outlook VBO to send an email with this screenshot as an attachment
Let me know if it helps!!
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blueprism 6x Certified Professional
Website:
https://devneet.github.io/Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.