Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
editable text, find accessible object
#1
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
#2
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");.
#3
Thanks Gintaras
Seems like the program is using Microsoft Edge:
https://flic.kr/p/2r8Gj8V[Image: 2r8Gj8V]
What is the best way in LA to find HTML elements or web accessible objects? I'm used to QM "HTML element find"
#4
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
#5
The class of the window (parent) is HwndWrapper[DefaultDomain;* , if that help in any way?
#6
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
#7
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:
 
Code:
Copy      Help
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:
 
Code:
Copy      Help
// 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:
Code:
Copy      Help
// 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();
#8
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!
#9
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?
#10
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.
#11
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
#12
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.
#13
thanks Gintaras. Just for my own info, where in the registry are these values saved for LA?
#14
Google: registry Run key
#15
Thank you


Forum Jump:


Users browsing this thread: 1 Guest(s)