Intermittent failure with UiPath Take Screenshot Activity

Hi,

I am having intermittent failure with Take Screenshot activity. The activity doesn’t work returning a null screenshot causing the downstream Save Screenshot activity to fail with “Object reference not set to an instance of an object.”.

Note: The above mentioned error with TakeScreenshot always happens in Catch block when the activity (e.g. Clicking a button) in the Try block encounters “Timeout reached” error.
For example (in Pseudo Code)
Try
Click a button
Catch
Take a Screenshot and save it

We are running unattended robot from Orchestrator with UiPath version 2018.4.3 with UIPATH.UIAUTOMATION.ACTIVITIES version 18.4.4.

Our program is using the default TakeScreenshot.xaml workflow from REFramework.

The unattended robot runs on Windows Server 2012R2.

Does anyone has any idea the root cause of intermittent failure with TakeScreenshot activity? And why this failure always happens when an activity in try block has “Timeout reached” error.

Any suggestion is appreciated.

P.S I am aware of the announcement by UiPath: “Before UIAutomation v20.6-preview, irrelevant of the ContinueOnError property, any exceptions that happened did not throw a visible exception, stopping the execution of the workflow, but simply returned a null screenshot. Starting with v20.6-preview, any exception thrown by this activity stops the execution of the workflow and may cause breaking changes in older workflows.”

Thanks!

Hi monmon,
In ‘Save Screenshot’ activity, Can you try changing ‘WaitForReady’ property to ‘NONE’ and try testing again. :slight_smile:

@tavineei do you mean “TakeScreenshot” activity? I don’t see ‘WaitForReady’ property under “SaveImage”(SaveScreenshot) activity.

Yes, ‘Take screenshot’ activity.
takescreenshot