I am using a flow where, in some point, I use the "Take screenshot of a webpage" action, with the "Capture:Specific element" option. The problem is that for some time, the flow has been randomly stuck in that step with "failed to capture image" error.
Sometimes it crashes after 5 - 10 screenshots, other times immediately after running. I made multiple selectors of that UI element but in vain.
I don't get it. I have the "Wait for web page content" before, with the same UI element and flow is passes with no error.
I reinstalled PAD and Firefox add-on (I am using Firefox browser) but no results.
Any insight will be appreciated. Thanks!
Errors message:
Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Failed to capture image. ---> PInvoke.Win32Exception: Invalid window handle
at PInvoke.User32.GetWindowPlacement(IntPtr hWnd)
at Microsoft.Flow.RPA.Desktop.UIAutomation.Core.Native.Window.WANativeWindow.<>c__DisplayClass67_0.<BringToFront>b__1()
at Microsoft.Flow.RPA.Desktop.UIAutomation.Core.Utilities.Clock.Execute[T](Int64 maxMillisecondsToWait, Int32 step, Func`1 action, Func`2 successCondition)
at Microsoft.Flow.RPA.Desktop.UIAutomation.Core.Native.Window.WANativeWindow.BringToFront(Boolean ensureForegroundStatus, Boolean useWindowStateHacks, Int32 timeout)
at Microsoft.Flow.RPA.Desktop.UIAutomation.WebAutomation.Core.Browser.AutomationBrowserBase.EnsureWindowIsVisible(INativeWindow waNativeWindow)
at Microsoft.Flow.RPA.Desktop.UIAutomation.WebAutomation.Core.WebExtensionsBrowser.WebExtensionsBrowserBase.CaptureWebPageImage(Single scaling, Int32 tryCount)
at Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.WebAutomationRuntime.TakeScreenshotOfWebPage(IWebAutomationBrowser webExtensionsBrowser, String cssSelectorOfElementToCapture, WebPageImageCapturingOperationEnum webPageImageCapturingOperation)
at Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.WebAutomationActions.TakeScreenshotOfWebPage(IWebBrowserInstanceFacade webBrowserInstance, String cssSelectorOfElementToCapture, String fileName, Int32 webPageImageCapturingOperation, Boolean copyToClipboard, Int32 fileFormat)
at Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.TakeScreenshotBase.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.TakeScreenshotBase.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)
Error action
Action settings