Error HRESULT E_FAIL has been returned from a call to a COM component


I’m facing this error whenever I’m trying to spy an element on a desktop based java application. ( It is failing for all the operations ( get text, click item or any other type of spy mechanism in UiPath.
Changing the DTC properties is not helping. Tried installing chrome extension and all and it did not help as well.

1:27:31:244 => [ERROR] [UiPath.Workflow.Logging.StudioTraceListener] [12] System.Exception: Step was not recorded successfully. —> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
at UiPath.UiNodeClass.GetSelector(Boolean refreshSel)
at UiPath.Core.UiElement.get_Selector()
at UiPath.Workflow.Wizards.ElementRecordingInfo.Init(UiElement element, UiElement topParent, Image image)
at UiPath.Workflow.Wizards.ClickControl.Init(UiElement element, UiElement topParent, Image image)
at UiPath.Workflow.Wizards.RecordingManager.InitRecordingStep(RecordingInfo recordingInfo, UiElement element, Image image)
at UiPath.Workflow.Wizards.RecordingManager.RecordStep(String wizAction)
at UiPath.Workflow.Wizards.RecordingManager.ProcessWizard(String action)
at UiPath.Workflow.ViewModels.WizardViewModel.OpenWizard(String action)
— End of inner exception stack trace —

Hi @saurabh_singh,

Have you installed Java Extension for automation ?

Please check this link. UiPath and Java


Hi Vikas,

Thanks for a quick response. I had the java extension configured already. Validate with process explorer as well.
As per the link provided , i have also validated all the prerequisite for java extension and all were successful.
Also tried UI explorer and selectors are not appearing in UiExplorer for any of the elements(fields) which are required to be read from the application screen.

Hi @saurabh_singh,

Can you tell the application name which you are trying to automate?

Is it specific to that application or even for other applications too? If yes, please provide the list of the application names.


Hi V
I have also experienced the same error when trying to get the attribute of a SAP button until it become clickable. Please see my post here: How to wait until an element is clickable, before the robot clicks on it?

It is a proprietary client application and have some java accessibility limitation the core platform. So I went for webversion. ( autogenerated web version for java apps ) . Automation such web version is another level of challenge and I had to write/identify custom selectors for almost all the fields to make it work.