I want to extract innerHtml from an electron window(html) . How can I do that?

We have a framework where we have many html documents in electron windows. How can I get the innerHtml property or inner text of the html ?

I tried extracting innerhtml, but throws an error node not supported

Hello @lokeshwar.manoharan

Can you try with Get Attribute activity? Privide the respective attribute to get the value.


I tried that and that was the one that is failing that node is not supported.
Will document be detected as html on electron window by UI path ?

Hello @lokeshwar.manoharan,

The latest LTS Release 2022.10 includes a new feature that might help. You can use now standard web selectors (html, webctrl) instead of IA2-based selectors (wnd, ctrl) for Electron/Chromium Widgets applications. This way you can automate your Electron application like any other web application, using web selectors.

The feature can be enabled from Project Settings:

  1. Navigate to the Project Settings window.
  2. In the Activity Settings list, select UI Automation Classic.
  3. Navigate to the Browser section.
  4. Set Enable WebView2 Native Automation to True.

This setting will aply both to Classic and Modern UI Automation activities.

Please try using UiPath.UIAutomation.Activities package version 22.10.3 and let us know if this helps to solve your issue.

Kind regards,

Thanks Luiza

Do you have a sample project or code that can help this ?
I followed your step by enabling webView2 Native automation.
How can I use web selector on electron window ?

Hi @lokeshwar.manoharan ,

Attached is a sample project built for UiPath Assistant, which is an Electron app. This project already has the Project Setting “Enable WebView2 Native Automation” set on True, as explained in the previous message.
If you check the selectors generated in this workflow, you can observe the standard web selectors (html, webctrl).
There are a few examples for using the Get Attribute activity to obtain the innerhtml or innerText attributes values.

WebView2Sample.zip (375.9 KB)

Thank you very much Luiza. Noticed that we are on old version of UI path 2022.4 and these activities are not recognized. Will follow up how can we preview the 2022.10 version. Thanks