I created an HDRobot, and it’s working perfectly.
I have five workflows that run one after another using Invoke.
The first workflow is triggered by a Node-RED agent every 10 minutes. It worked fine more than ten times.
Then I changed the schedule to run once per day and left it running. After about 8 hours, I checked it and saw that the third workflow failed with the following errors in different runs:
"msg": "System.Exception: FazeliServer/webcartMission failed with Failed locating item ---> OpenRPA.Interfaces.ElementNotFoundException: Failed locating item
at OpenRPA.Image.GetElement.StartLoop(NativeActivityContext context)
at OpenRPA.Interfaces.BreakableLoop.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager)
--- End of inner exception stack trace ---
at OpenRPA.Activities.InvokeOpenRPA.OnBookmarkCallback(NativeActivityContext context, Bookmark bookmark, Object obj)"
"msg": "System.ComponentModel.Win32Exception (0x80004005): The handle is invalid
at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX,
Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize)
at OpenRPA.Interfaces.Image.Util.Screenshot(Int32 x, Int32 y, Int32 width, Int32 height)
at OpenRPA.Interfaces.Image.Util.Screenshot()
at OpenRPA.Image.ImageEvent.findMatch()"
I tried several times, and the same error happened again.
However, when I turned off the HDRobot and connected via Remote Desktop, the last workflow (which was stuck) immediately continued and completed successfully!
After that, I turned the HDRobot back on, and everything started working fine again.
Could you please help me understand what’s causing this issue?
- Why does it stop working after a few hours?
- Is this related to Windows, or could it be something in my workflow design?
- And finally, is there a way to automatically take a screenshot when such an error occurs?