Error saving an image

Scenario:I want to use the activity Take a screenshot and Save the image on a folder

Steps to reproduce: I did an activity take screenshot without selector, because I want to obtain all the screen and just after that, I put a save image activity

Current Behavior: I’ve the error “Launch Workflow Interactive: Save image : Object reference not set to an instance of an object.”

Expected Behavior:The robot saves the screenshot on a specified folder

Studio/Robot/Orchestrator Version: Both on 2017 version

Last stable behavior:
Last stable version:
OS Version: Windows Server 2012
Others if Relevant: (workflow, logs, .net version, service pack, etc):

Hello there,
Yes selector is optional.
Here we go.
TakeScreenShot.xaml (7.1 KB)

2 Likes

Thanks, it works!

However the mine worked yesterday, I don’t know why today it crashes… Someone else have an answer about this?

Are you still getting “Object reference not set to an instance of an object” on the Save Image activity?

You can try using a Write Line or Message with imageVariable.ToString to see if it outputs something cause if it throws an error then your image is empty.

If it helps I’m using this as my selector for the Take Screenshot activity to take entire screen:
“<wnd app=‘explorer.exe’ cls=‘Progman’ title=‘Program Manager’ /><wnd cls=‘SysListView32’ title=‘FolderView’ />”

Regards.

Hi, I have the same problem with saving screenshot. The process works some times and other times it fails. I tried adding a step after capturing screenshot without selector, where, if image is nothing, I try to capture it again with the entire screen selector suggested by ClaytonM. It still does not always work. Is there a solution to this problem?

Hi @tea, can you show exactly what it’s doing like is there an error message? Also, .xaml or a snippet of your activities used showing the parameters would be helpful.

Hi, this turned out to be a bug in UiPath which they are now fixing. :slight_smile:

Hi By when this will be fixed?

Is the bug fixed now? Im still getting this error occasionally.

Hi,
We are getting Null Reference Exception error, while saving captured screenshot.
Error details given below.

Save ScreenShot:System.NullReferenceException: Object reference not set to an instance of an object.\r\n at UiPath.Core.Activities.TaskAsyncCodeActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)\r\n at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)\r\n at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Any help will be appreciated.

Thanks & Regards,
Shreekrishna

Hi, I am getting this error very frequently for a week now. Is this bug fixed?

1 Like