Take screenshot activity works properly on local machine, but fails when using an unattended robot on virtual machine (AWS EC2) with following error:
Take Screenshot: 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(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize, CopyPixelOperation copyPixelOperation) at UiPath.Vision.UiImage.FromScreenRegion(Rectangle region) at UiPath.Core.Image…ctor(Region screenRegion)
I have tried logging out from RDP access as well but then the job is not executed and stays in pending state.
I have tried UiPath.UiAutomationNext.Activities.NTakeScreenshot but that does not update the file on disk, when I try to use mail activity to mail the screenshot I get Old screenshot image.
Do one thing bro please go to this url %userprofile%.nuget\packages in the virtual machine
Then please check in the project folder and keep on clicking until you get the project then you just debug it and if the bot is not take screenshot then you debug it you will get the solution may be
and what am thinking is its a selector problem may be i am not sure but try once
I hope it was a selector problem please check
Thanks, for helping out @copy_writes . But I don’t think anything is wrong with the selectors, I am passing the output element of use browser activity for screenshot. Same script runs perfectly on local machine. And yes I went into the project folder, but I don’t see any screenshot taken.