Take Screenshot: Object reference not set to an instance of an object

Hi Everyone,

I have a workflow which only takes a screenshot. But although it works fine on my local PC, It gets the following error from orchestrator, on remote desktop.

image

image

Robot has access to the folder so it shouldn’t be a problem. Also here is my workflow:

I have also tried calling TakeScreenshot.xaml inside Process xaml on Reframework. That one also works fine on my local and gets the same error on orchestrator.

Any ideas why this is happening? Thanks in advance.

2 Likes

Hi @dcrt,

This is most probably due to the double slash at the beginning.

Assuming that is the issue, One best resolution I can say is to map that drive in the remote desktop like either a G drive or E drive. Then try giving the path so that it may work without breaking.

Hope this helps

Thanks :slight_smile:

1 Like

Hi,

Perhaps the bot doesn’t generate a user session on the virtual machine? This happens if you have “Login to console” set to “yes”.

Check in your Orchestrator in robot settings whether it is set correctly:
image

Cheers
Andrzej

Hello, thanks for your reply, the settings seem correct. Probably something else.

Hello, thank you for your answer, I tried but still getting the same error unfortunately.

1 Like

Kindly check whether all required access is provided and also the path format is right without any spaces.

Thanks

I have checked also asked a friend if I am doing anything wrong but couldn’t see anything. :frowning:

1 Like

Could you please share the full path after mapping your path to a drive.

Thanks :slight_smile:

Here it is, i also tried without Environment.UserName

“C:\Users"+Environment.UserName+”\Downloads\Untitled.png"

1 Like

Is this your local path ?

Yes it is.
Also we have some processes that uses the path with \, in Reframework on TakeScreenshot.xaml but they work alright.

1 Like

Print the entire path in log message before passing it.

Also use path exists activity once please.

This may help to debug

We tried everything but can’t seem to find a reason, :frowning:

1 Like

Can u send a screenshot of the output panel please

Hey, thanks again for all the help.
I put a 2 mins delay at the start of the process and that solved the case. Appaerently remote machines are not ready for screenshots for a couple of minutes.

Thank you.

2 Likes

weird thing also is that a trycatch does not preven the crash for some reason.

1 Like

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