I’ve got an issue where a process does the following:
Takes a Screenshot of a window
Saves the screenshot to a specific filepath
This runs without issue when run through Studio on my laptop but when we run it on a robot session (unattended and not visible) it will throw the Object not set… exception at the Save Image part, implying the screenshot has not been taken (even after a 30 second timeout)
If I log into the robot session and watch the process, it works fine. Which leads me to my question…
Does the Take Screenshot activity need to be in an active, visible session to work? If not, any ideas what could be the issue here? It’s driving me mad!
How are you executing the unattended robot? if via orchestrator I’ve had this issue before and resolved by changing the robot properties to ensure I was not logging in via console. If you are using another mechanism i.e. Windows scheduler then it needs an interactive session to take a screenshot, and this will not work.
Save image | Save Screenshot : Object reference not set to an instance of an object.
Meaning, the screenshot has not been taken and the variable is empty. As I mentioned initially, this runs fine on an active session so the activities aren’t the problem
@md.kashif464 - No, we are using the on premise Enterprise edition
This issue normally occurs when the variable is not initialised (doesn’t have a value). What variable type is your variable? You can try using an Assign before the activity that breaks, like so:
MyVar = ""
This will initialise the variable and give it a blank value
I’ve not used image variables before. Have a look at this stackOverflow post and see if that is any help. It is for a Java console app but may assist you.