@Descolada
I don't know if this is intended but when I download the zip package from your github, and extract, the files are with the following encoding:
UIA_Interface.ahk - UTF-8 with BOM
UIA_Constants.ahk - UTF-8
UIA_Browser.ahk - UTF-8 with BOM
UIAViewer.ahk - UTF-8
UIATreeInspector.ahk - UTF-8 with BOM
Do you think this can cause some issues?!
UIAutomation with a focus on Chrome
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: UIAutomation with a focus on Chrome
@leosouza85, thanks for notifying! This is fixed now (and yes, potentially could cause problems).
-
- Posts: 1
- Joined: 28 Jul 2022, 00:45
Re: UIAutomation with a focus on Chrome
Thank you @Descolada for your great tool
When I double click UIAViewer.ahk I get the following message: Are there any dependencies that I need to install?
When I double click UIAViewer.ahk I get the following message: Are there any dependencies that I need to install?
Re: UIAutomation with a focus on Chrome
Force-local mode was introduced a while ago, in AHK v1.1.27.
Re: UIAutomation with a focus on Chrome
@eggsterino, as user gregster mentioned, the issue isn't a dependency but that your AHK version is old, so you might be better off updating your AHK. But since the line causing the error wasn't strictly necessary, I removed it and updated the UIAViewer.ahk in GitHub: you could try if it works now.
Re: UIAutomation with a focus on Chrome
Thank you!
Re: UIAutomation with a focus on Chrome
Hi, @Descolada
in the first post is one letter "t" too much, UIA_Element.Hightlight(displayTime:=2000, color:="Red", d:=4)
I have a ComboBox on a web page, I can set the value cUIA.FindFirstByType("ComboBox").SetValue("Test123"), but as soon as I click send button, I get the message that the field is empty. can I dispatch this without javascript?
in the first post is one letter "t" too much, UIA_Element.Hightlight(displayTime:=2000, color:="Red", d:=4)
I have a ComboBox on a web page, I can set the value cUIA.FindFirstByType("ComboBox").SetValue("Test123"), but as soon as I click send button, I get the message that the field is empty. can I dispatch this without javascript?
Re: UIAutomation with a focus on Chrome
Thanks, fixed.
I've encountered the same problem. It seems that even though ValuePattern is available for comboboxes, setting the value doesn't actually *select* a combobox list item. I haven't tested it with comboboxes which support inserting custom values. So far I've gotten around this problem by using cUIA.FindFirstByType("ComboBox").ExpandCollapsePattern.Expand() and then cUIA.WaitElementExistByNameAndType("Test123", "ListItem").Click(). Alternatively you could use cUIA.FindFirstByType("ComboBox").SetFocus() and then Send or ControlSend: this should also work if the combobox allows you to insert custom values as well (not just select list items).I have a ComboBox on a web page, I can set the value cUIA.FindFirstByType("ComboBox").SetValue("Test123"), but as soon as I click send button, I get the message that the field is empty. can I dispatch this without javascript?
Re: UIAutomation with a focus on Chrome
Hello @Descolada . Taking advantage that you are online.
I am using an element search by Name and ControlType, but using a variable for Name. Where LanguagueTarget is the variable.
Does the library accept variable names?
I am using an element search by Name and ControlType, but using a variable for Name. Where LanguagueTarget is the variable.
Does the library accept variable names?
Code: Select all
cEl.FindFirstBy("NAME=%LanguagueTarget% AND ControlType=Button").Click("left")
Last edited by mora145 on 31 Jul 2022, 00:28, edited 1 time in total.
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: UIAutomation with a focus on Chrome
@Descolada
Thank you again for all your work! I think that would be interesting a button that copy all the content of the constructed tree on UIA Viewer and Tree Inspector... or there is a way that I not saw?
Thank you again for all your work! I think that would be interesting a button that copy all the content of the constructed tree on UIA Viewer and Tree Inspector... or there is a way that I not saw?
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: UIAutomation with a focus on Chrome
Code: Select all
caixadialogo := cUIA.FindFirstByType("Custom")
msgbox % caixadialogo.DumpAll()
texto := caixadialogo.FindAllByType("Text")
msgbox % texto.DumpAll()
what I'm doing wrong?
Edit: If I use findfirstbyname or findfirstbytype it works for finding the first element. but findall is finding nothing
Last edited by leosouza85 on 31 Jul 2022, 00:05, edited 2 times in total.
Re: UIAutomation with a focus on Chrome
@leosouza85, currently there isn't a way to copy the whole constructed tree to clipboard, simply because I haven't found a need for it so far As an alternative you can use DumpAll to do that instead, and if it doesn't contain enough properties for your liking then you could easily modify the Dump method to add additional properties (e.g. BoundingRectangle). Do you have an example where copying the whole tree would be useful?
In the code you provided, in the first case FindFirst returns an element, and since DumpAll is a method for element objects, it works. In the second case the FindAll returns an element ARRAY, which isn't an element object. So you need to loop over the array and Dump the individual elements: texto[1].Dump() would Dump the first found element for example.
In the code you provided, in the first case FindFirst returns an element, and since DumpAll is a method for element objects, it works. In the second case the FindAll returns an element ARRAY, which isn't an element object. So you need to loop over the array and Dump the individual elements: texto[1].Dump() would Dump the first found element for example.
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: UIAutomation with a focus on Chrome
Thank You for the explanation! The use case for copying the constructed tree is to paste it somewhere to search for the terms more confortably, without the need to write a script for that.Descolada wrote: ↑30 Jul 2022, 23:13@leosouza85, currently there isn't a way to copy the whole constructed tree to clipboard, simply because I haven't found a need for it so far As an alternative you can use DumpAll to do that instead, and if it doesn't contain enough properties for your liking then you could easily modify the Dump method to add additional properties (e.g. BoundingRectangle). Do you have an example where copying the whole tree would be useful?
In the code you provided, in the first case FindFirst returns an element, and since DumpAll is a method for element objects, it works. In the second case the FindAll returns an element ARRAY, which isn't an element object. So you need to loop over the array and Dump the individual elements: texto[1].Dump() would Dump the first found element for example.
@Descolada I've never seen anybody using the following syntax:
Code: Select all
caixadialogo := cUIA.FindFirstByType("Custom").FindFirstByName("Recebido",,2)
Last edited by leosouza85 on 31 Jul 2022, 13:43, edited 1 time in total.
Re: UIAutomation with a focus on Chrome
Hi @Descolada , Have you been able to see this?mora145 wrote: ↑30 Jul 2022, 14:13Hello @Descolada . Taking advantage that you are online.
I am using an element search by Name and ControlType, but using a variable for Name. Where LanguagueTarget is the variable.
Does the library accept variable names?
Code: Select all
cEl.FindFirstBy("NAME=%LanguagueTarget% AND ControlType=Button").Click("left")
(Excuse my English, I speak native Spanish).
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: UIAutomation with a focus on Chrome
Hi, I'm not descolada but I think I can help you...mora145 wrote: ↑31 Jul 2022, 13:23Hi @Descolada , Have you been able to see this?mora145 wrote: ↑30 Jul 2022, 14:13Hello @Descolada . Taking advantage that you are online.
I am using an element search by Name and ControlType, but using a variable for Name. Where LanguagueTarget is the variable.
Does the library accept variable names?
Code: Select all
cEl.FindFirstBy("NAME=%LanguagueTarget% AND ControlType=Button").Click("left")
(Excuse my English, I speak native Spanish).
Try that way:
Code: Select all
cEl.FindFirstBy("NAME=" LanguagueTarget " AND ControlType=Button").Click("left")
Re: UIAutomation with a focus on Chrome
Ty. I have tried using syntaxys like that, but the libs read the string as a full stringleosouza85 wrote: ↑31 Jul 2022, 13:42Hi, I'm not descolada but I think I can help you...mora145 wrote: ↑31 Jul 2022, 13:23Hi @Descolada , Have you been able to see this?mora145 wrote: ↑30 Jul 2022, 14:13Hello @Descolada . Taking advantage that you are online.
I am using an element search by Name and ControlType, but using a variable for Name. Where LanguagueTarget is the variable.
Does the library accept variable names?
Code: Select all
cEl.FindFirstBy("NAME=%LanguagueTarget% AND ControlType=Button").Click("left")
(Excuse my English, I speak native Spanish).
Try that way:
Code: Select all
cEl.FindFirstBy("NAME=" LanguagueTarget " AND ControlType=Button").Click("left")
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: UIAutomation with a focus on Chrome
But I've tested here and it workedmora145 wrote: ↑31 Jul 2022, 13:44Ty. I have tried using syntaxys like that, but the libs read the string as a full stringleosouza85 wrote: ↑31 Jul 2022, 13:42Hi, I'm not descolada but I think I can help you...mora145 wrote: ↑31 Jul 2022, 13:23Hi @Descolada , Have you been able to see this?mora145 wrote: ↑30 Jul 2022, 14:13Hello @Descolada . Taking advantage that you are online.
I am using an element search by Name and ControlType, but using a variable for Name. Where LanguagueTarget is the variable.
Does the library accept variable names?
Code: Select all
cEl.FindFirstBy("NAME=%LanguagueTarget% AND ControlType=Button").Click("left")
(Excuse my English, I speak native Spanish).
Try that way:
Code: Select all
cEl.FindFirstBy("NAME=" LanguagueTarget " AND ControlType=Button").Click("left")
Can you paste the exact code that you tested in this syntax and didn't work?
for example, this code clicks on post reply here on the forum:
Code: Select all
test := "Post Reply"
browserExe := "chrome.exe"
WinActivate, ahk_exe %browserExe%
WinWaitActive, ahk_exe %browserExe%
sleep 500
cUIA := new UIA_Browser("ahk_exe " browserExe)
cUIA.FindFirstBy("Name=" test " AND Controltype=Hyperlink").Click()
return
Last edited by leosouza85 on 31 Jul 2022, 13:51, edited 1 time in total.
Re: UIAutomation with a focus on Chrome
FAIL DUPLICATED
Last edited by mora145 on 31 Jul 2022, 14:05, edited 1 time in total.
-
- Posts: 90
- Joined: 22 Jul 2016, 16:28
Re: UIAutomation with a focus on Chrome
Your post duplicated, I did some clarification on the post before this.mora145 wrote: ↑31 Jul 2022, 13:50Ty. I have tried using syntaxys like that, but the libs read the string as a full stringleosouza85 wrote: ↑31 Jul 2022, 13:42Hi, I'm not descolada but I think I can help you...mora145 wrote: ↑31 Jul 2022, 13:23Hi @Descolada , Have you been able to see this?mora145 wrote: ↑30 Jul 2022, 14:13Hello @Descolada . Taking advantage that you are online.
I am using an element search by Name and ControlType, but using a variable for Name. Where LanguagueTarget is the variable.
Does the library accept variable names?
Code: Select all
cEl.FindFirstBy("NAME=%LanguagueTarget% AND ControlType=Button").Click("left")
(Excuse my English, I speak native Spanish).
Try that way:
Code: Select all
cEl.FindFirstBy("NAME=" LanguagueTarget " AND ControlType=Button").Click("left")
Re: UIAutomation with a focus on Chrome
Ty. I have tried using syntaxys like that, but the libs read the string as a full string
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 103 guests