Posts: 67
Threads: 21
Joined: Aug 2019
Hello,
I'm attempting to interact with a program that has an editable text field.
I tried using "find UI element" to find it, but with no success, even with using flag hidden
I looked under all listree entries generated by "find UI element", but not there
Any suggestion/creative way to obtain it's object?
Thanks in advance
Posts: 12,188
Threads: 144
Joined: Dec 2002
Try to check UIA and then move the mouse over that UI object.
Try Shift+F3 , while the mouse is in that window, to switch the capturing method.
If the window class name is like "SunAwtFrame", try to enable JAB, for example in Options > OS.
If nothing works, use the "Find image" tool instead.
If want to focus that object, often the easiest and best way is keyboard, like keys.send("Tab*3"); .
Posts: 67
Threads: 21
Joined: Aug 2019
Thanks Gintaras
Seems like the program is using Microsoft Edge:
https://flic.kr/p/2r8Gj8V![[Image: 2r8Gj8V]](https://flic.kr/p/2r8Gj8V)
What is the best way in LA to find HTML elements or web accessible objects? I'm used to QM "HTML element find"
Posts: 67
Threads: 21
Joined: Aug 2019
Is there any way you can think of to interact with this program while avoiding using ''Find image''? I will be forever grateful. I can use any diagnostic tool or inspection tool you can think of.
As always, always appreciate your expertise
Posts: 67
Threads: 21
Joined: Aug 2019
The class of the window (parent) is HwndWrapper[DefaultDomain;* , if that help in any way?
Posts: 12,188
Threads: 144
Joined: Dec 2002
The image shows that the program uses Webview2 control. UI elements should work there. Are UI elements unavailable in entire control? Or only for edit fields like this? If in entire control, try to set this environment variable before running the program:
WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--force-renderer-accessibility
As always, to propagate changes in environment variables, may need to sign out/in.
If that does not work, try Playwright. It seems it can work with Webview2 control, but I still did not test. Links:
https://playwright.dev/docs/webview2
https://www.libreautomate.com/cookbook/W...right.html
Posts: 12,188
Threads: 144
Joined: Dec 2002
Tested, Playwright can be used.
Setup (if you don't have Playwright and Playwrighter): see Cookbook recipe "Web browser automation with Playwright".
Script to run your program with Playwright connections enabled:
Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", "--remote-debugging-port=9225");
run.it(@"C:\path to your program.exe");
Script to show the Playwright recorder for your app:
// script "Test Playwright WebView2 - record.cs"
/*/ c Playwrighter.cs; /*/
using var play = Playwrighter.Connect(out var page, "*", new(9225), debug: true);
var w1 = wnd.find(10, "Playwright Inspector*", "Chrome_WidgetWin_1");
w1.WaitForClosed(0);
The Playwright recorder does not work well in "connect" mode. Recording works, but it leaves some artifacts in the UI, and next time recording does not work. After recording, restart your app.
Example script that finds and clicks a link in your app:
// script "Test Playwright WebView2.cs"
/*/ c Playwrighter.cs; /*/
using Microsoft.Playwright;
using var play = Playwrighter.Connect(out var page, "*", new(9225));
print.it(page.Url);
//this code was recorded with the Playwright recorder (copied from its window)
await page.GetByRole(AriaRole.Link, new() { Name = "Forum" }).ClickAsync();
Posts: 67
Threads: 21
Joined: Aug 2019
Thanks Gintaras. Regarding your first question, only some UI elements are available, others are not for this program.
Thanks for the recommendations of Playwright and your researching into it, I really appreciate it. I will give it a try!
Posts: 67
Threads: 21
Joined: Aug 2019
I am having issues installing playwrite:
https://flic.kr/p/2r8GfCU
I have dotnet source files in separate folder (I don't have admin rights where I am) and have been successful in using dotnet commends in that folder, including:
dotnet add package Microsoft.Playwright --version 1.52.0
when commend prompt is directed to that folder
any advice as to how to go about this? Do I need to add the path in the text field of the dialog box shown in the image to direct it to the dotnet folder?
Posts: 12,188
Threads: 144
Joined: Dec 2002
06-06-2025, 03:33 AM
(This post was last modified: 06-06-2025, 03:34 AM by Gintaras.)
The dotnet folder path must be in the PATH environment variable. Normally the .NET runtime or SDK setup program adds it there. If it is not there, add manually. In any case, try to sign out and sign in again; need it too propagate environment variables to all programs.
Posts: 67
Threads: 21
Joined: Aug 2019
06-09-2025, 03:38 PM
(This post was last modified: 06-09-2025, 04:35 PM by cuitino.)
Thank you Gintaras
After doing this, now LA does not recognize even other windows that it previously did (not just Edge). I need to manually open "find UI element" dialog for search, only then does it find them programmatically. Any resolution for this?
shell: startup folder shortcuts don't auto-lunch on login either anymore
I actually figured out the LA not recognizing the windows. However the shell: startup folder shortcuts wouldn't lunch automatically upon login
Ok so I figured out solutions:
for my comment "LA does not recognize even other windows that it previously did", just had to make sure that the "@Triggers and toolbars" folder is at the top most of LA.
For startup, for some reason the computer would no longer launch LA only, I just created batch file as apposed to the shortcut to achieve same results
Thanks
Posts: 12,188
Threads: 144
Joined: Dec 2002
06-09-2025, 05:08 PM
(This post was last modified: 06-09-2025, 05:11 PM by Gintaras.)
Maybe disabled in Task Manager > Startup apps.
But only Quick Macros uses the folder. LibreAutomate uses the Registry. When in Options the checkbox is checked, it adds its path to the Run key.
Posts: 67
Threads: 21
Joined: Aug 2019
thanks Gintaras. Just for my own info, where in the registry are these values saved for LA?
Posts: 12,188
Threads: 144
Joined: Dec 2002
Posts: 67
Threads: 21
Joined: Aug 2019
|