MarvKLM Posted September 20, 2021 Share Posted September 20, 2021 Hi. I can't figure out why the same below example works for fine for me on W7 but it fails to show all texts in W10. I have searched the forum and Google to see if there is something specific to the new W10 build (20H2) but i couldn't find annything. This is the original example i'm using fine in W7: Spoiler expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ;~ #AutoIt3Wrapper_UseX64=n ; If target application is running as 32 bit code ;~ #AutoIt3Wrapper_UseX64=y ; If target application is running as 64 bit code #include <UIA_Constants.au3> ;#include "UIA_Functions.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_SafeArray.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_Variant.au3" ; Can be copied from UIASpy Includes folder Opt( "MustDeclareVars", 1 ) Example1() Func Example1() ; Create UI Automation object Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtag_IUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement( $pDesktop ) $oDesktop = ObjCreateInterface( $pDesktop, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oDesktop ) Then Return ConsoleWrite( "$oDesktop ERR" & @CRLF ) ConsoleWrite( "$oDesktop OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pPane1, $oPane1 $oDesktop.FindFirst( $TreeScope_Descendants, $pCondition0, $pPane1 ) $oPane1 = ObjCreateInterface( $pPane1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oPane1 ) Then Return ConsoleWrite( "$oPane1 ERR" & @CRLF ) ConsoleWrite( "$oPane1 OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition1 $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_TextControlTypeId, $pCondition1 ) If Not $pCondition1 Then Return ConsoleWrite( "$pCondition1 ERR" & @CRLF ) ConsoleWrite( "$pCondition1 OK" & @CRLF ) #cs Local $pText1, $oText1 $oPane1.FindFirst( $TreeScope_Descendants, $pCondition1, $pText1 ) $oText1 = ObjCreateInterface( $pText1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oText1 ) Then Return ConsoleWrite( "$oText1 ERR" & @CRLF ) ConsoleWrite( "$oText1 OK" & @CRLF ) #ce Local $pElements $oPane1.FindAll( $TreeScope_Descendants, $pCondition1, $pElements ) ; --- Code Snippets --- ConsoleWrite( "--- Code Snippets ---" & @CRLF ) Local $oUIElementArray1, $iLength1 ; $pElements is a pointer to an UI Automation element array $oUIElementArray1 = ObjCreateInterFace( $pElements, $sIID_IUIAutomationElementArray, $dtag_IUIAutomationElementArray ) $oUIElementArray1.Length( $iLength1 ) If Not $iLength1 Then Return ConsoleWrite( "$iLength1 = 0 ERR" & @CRLF ) ConsoleWrite( "$iLength1 = " & $iLength1 & @CRLF ) ; --- Code Snippets --- ConsoleWrite( "--- Code Snippets ---" & @CRLF ) Local $pElement1, $oElement1, $sValue1 For $i = 0 To $iLength1 - 1 $oUIElementArray1.GetElement( $i, $pElement1 ) $oElement1 = ObjCreateInterface( $pElement1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) $oElement1.GetCurrentPropertyValue( $UIA_NamePropertyId, $sValue1 ) ConsoleWrite( "$sValue1 = " & $sValue1 & @CRLF ) Next EndFunc And then I changed some of the static variables for the W10, but both fails to show all text elements. Spoiler expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ;~ #AutoIt3Wrapper_UseX64=n ; If target application is running as 32 bit code ;~ #AutoIt3Wrapper_UseX64=y ; If target application is running as 64 bit code #include <UIA_Constants.au3> ;#include "UIA_Functions.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_SafeArray.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_Variant.au3" ; Can be copied from UIASpy Includes folder Opt( "MustDeclareVars", 1 ) Example2() Func Example2() ; Create UI Automation object Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation8, $sIID_IUIAutomation6, $dtag_IUIAutomation6 ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement( $pDesktop ) $oDesktop = ObjCreateInterface( $pDesktop, $sIID_IUIAutomationElement9, $dtag_IUIAutomationElement9 ) If Not IsObj( $oDesktop ) Then Return ConsoleWrite( "$oDesktop ERR" & @CRLF ) ConsoleWrite( "$oDesktop OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pPane1, $oPane1 $oDesktop.FindFirst( $TreeScope_Descendants, $pCondition0, $pPane1 ) $oPane1 = ObjCreateInterface( $pPane1, $sIID_IUIAutomationElement9, $dtag_IUIAutomationElement9 ) If Not IsObj( $oPane1 ) Then Return ConsoleWrite( "$oPane1 ERR" & @CRLF ) ConsoleWrite( "$oPane1 OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition1 $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_TextControlTypeId, $pCondition1 ) If Not $pCondition1 Then Return ConsoleWrite( "$pCondition1 ERR" & @CRLF ) ConsoleWrite( "$pCondition1 OK" & @CRLF ) #cs Local $pText1, $oText1 $oPane1.FindFirst( $TreeScope_Descendants, $pCondition1, $pText1 ) $oText1 = ObjCreateInterface( $pText1, $sIID_IUIAutomationElement9, $dtag_IUIAutomationElement9 ) If Not IsObj( $oText1 ) Then Return ConsoleWrite( "$oText1 ERR" & @CRLF ) ConsoleWrite( "$oText1 OK" & @CRLF ) #ce Local $pElements $oPane1.FindAll( $TreeScope_Descendants, $pCondition1, $pElements ) ; --- Code Snippets --- ConsoleWrite( "--- Code Snippets ---" & @CRLF ) Local $oUIElementArray1, $iLength1 ; $pElements is a pointer to an UI Automation element array $oUIElementArray1 = ObjCreateInterFace( $pElements, $sIID_IUIAutomationElementArray, $dtag_IUIAutomationElementArray ) $oUIElementArray1.Length( $iLength1 ) If Not $iLength1 Then Return ConsoleWrite( "$iLength1 = 0 ERR" & @CRLF ) ConsoleWrite( "$iLength1 = " & $iLength1 & @CRLF ) ; --- Code Snippets --- ConsoleWrite( "--- Code Snippets ---" & @CRLF ) Local $pElement1, $oElement1, $sValue1 For $i = 0 To $iLength1 - 1 $oUIElementArray1.GetElement( $i, $pElement1 ) $oElement1 = ObjCreateInterface( $pElement1, $sIID_IUIAutomationElement9, $dtag_IUIAutomationElement9 ) $oElement1.GetCurrentPropertyValue( $UIA_NamePropertyId, $sValue1 ) ConsoleWrite( "$sValue1 = " & $sValue1 & @CRLF ) Next EndFunc Things I've tried: #RequireAdmin | No AV | Exec as Adm | Change Chrome compatibility on W10 | On W7, for example, inspecting the top of this page, Browse shows HyperlinkControl and TextControl: Now on W10, there are some changes. Custom Control changes to Group and no text. *I'm using the Browse link here as an example where it shows two controls in W7, my intention is to find all text (TextControl). Using the above snippet there many other plain texts in W10 missing, that shows on W7. Using UIASpy in Chrome - W10, I can see the TextControl of the "missing" elements but I can't find them using the above FindAll method. Link to comment Share on other sites More sharing options...
junkew Posted September 21, 2021 Share Posted September 21, 2021 Check first within chrome (versions, 32/64 bits) Check chrome://accessibility/ and see the trees as you then should see the same in UIA spy Check with inspect.exe as thats the original MS tool for spying uia Skysnake 1 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
LarsJ Posted September 21, 2021 Share Posted September 21, 2021 junkew, Have you tried the 3 options for checking things out yourself. In that case, you would have seen that MarvKLM is completely right. The controls are different in Windows 7 and 10. This applies to both UIASpy and Inspect.exe. I've no idea the reason for the differences. I've made a note of the issue and will investigate it further on occasion. But it'll not be right now because I'm working on other projects. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
MarvKLM Posted September 21, 2021 Author Share Posted September 21, 2021 Hi @junkew and @LarsJ, first thanks for the help. Answering junkew questions: Both machines with W7 and W10 OS and Chrome are x64 versions. Compiling the script in x64 does not change anything. On both cases (W7 and W10) Chrome does show the ROLE_SYSTEM_STATICTEXT looking in the accessibility tree. Inspect and UIASpy shows the same results. Some additional information: W10 new install, no AV, no other software, just Chrome x64. What I noticed is that both Inspect and UIASpy on W10 can detect elements that are text only, but not all of them appear immediately in the inspection box, to find some elements it is necessary to manually search the tree to find them. Example: If you inspect at the top of this page for the text element of "Home > AutoIt v3 > AutoIt Help and Support > AutoIt General Help and Support > UI Automation on W10 - Get all texts in a Chrome document", it will show on both tools. But if yout try to find (hovering the mouse) the topic title (UI Automation on W10 - Get all texts in a Chrome document) right under the links paths of the forum, the element does not show on the right side of the inspecting tool, but it's possible to find it manually. Now other elements that should have two attributes like for example a link (HyperlinkControl and TextControl) in W10 are only shown the first one, although the element (Static Text) is appearing in the Chrome accessibility tree. I know you guys are busy, whenever you can help me, that's great. Thanks in advance. Link to comment Share on other sites More sharing options...
junkew Posted September 22, 2021 Share Posted September 22, 2021 I did not observe it myself yet but the basics are first to see within Chrome if the trees are equal on both platforms. If they are equal you the issue is MS otherwise its google chromium. Maybe check if same issue on ms edge. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
LarsJ Posted September 22, 2021 Share Posted September 22, 2021 I've searched a bit for information about the issue but have not really managed to find anything. It seems strange as Google is a huge company and Chrome is one of the most used browsers. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
MarvKLM Posted September 22, 2021 Author Share Posted September 22, 2021 @junkew the Chrome trees are equal on both platforms. Now on Edge W10 the example attribute of "Browse" shows both HyperlinkControl and TextControl: Spoiler But I still can't find it using FindAll (TextControl) on Edge W10. And I have no idea why they change the control name to Group or why Chrome only shows one attribute. @LarsJ I wasn't able to find anything either. Do you get the same fail FindAll results on W10 21H2? Link to comment Share on other sites More sharing options...
junkew Posted September 23, 2021 Share Posted September 23, 2021 I do not have a W7 around but can see in W10 the same as you see which is in my opinion correct a link WITHOUT a text. the text you can get from the link and in the HTML there is no subtag with specific text Can you inspect the html that is shown on both W7 and W10 When I look at the html its only showing a hyperlink no textbox <a href="https://www.autoitscript.com/forum/" data-navitem-id="1" data-navdefault="" data-active="true"> Browse<span class="ipsNavBar_active__identifier"></span> </a> Check what NVDA and Narrator is recognizing (but I assume that will be exactly same as what you are seeing) Did behavior change when upgrading from W10 to W10 21H2 or is it behaviour you see changed going from W7 to W10 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
LarsJ Posted September 23, 2021 Share Posted September 23, 2021 Assuming that this change in the UI Automation control structure is a consequence of updates in the latest versions of Chrome (i.e. not a real error), then it means, among other things, that it's not possible to find all texts in a document, simply by looking for controls of type $UIA_TextControlTypeId. Instead, you can traverse all elements of the document and print all valid $UIA_NamePropertyIds. This is done in UIASpy when generating the entire element structure of a window. See here how to do it. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
MarvKLM Posted September 25, 2021 Author Share Posted September 25, 2021 Hi. Sorry for the delay. @junkew let me answer your questions: The same HTML code for W7 and W10. This is is not just an hyperlink, because this is a text that was hyperlinked (ie. <a> attribute and the text "Browse" [javascript:var a = document.querySelector("#elNavSecondary_1 > a");alert(a.textContent);]). Also, as I said before, the tree shows the attribute STATICTEXT for all hyperlinks correctly. I only used "Browse" hyperlink as an example. The real problem is that FindAll method is not even showing the pure texts of the document. Look at the bellow image, you will see that there are two texts (same content because it's the topic title). FindAll only shows the first text, not the second. I think this could be a MS issue. On 9/23/2021 at 4:21 AM, junkew said: Did behavior change when upgrading from W10 to W10 21H2 or is it behaviour you see changed going from W7 to W10 I have two machines, one older with W7 (everything working properly) and a new Notebook that came with W10 21H2. So I can't compare with older versions of W10 to know if there is a problem with the new W10 build 21H2. @LarsJ I think that this is some MS bug, because if I try to traverse all elements (in my case using FindAll and TextControl types only) of the document and print all valid $UIA_NamePropertyIds, it will fail to find the second Text (and it's just a text, there are no other control property), as I pointed in the above image example. UIASpy uses FindAll or TreeWalker? I have always used FindAll, because the function returns only control elements. The strange is even if I try to find the specific Text element using ($oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "TEXT", $pCondition )) it fails. This is what I see in W10 using UIASpy, if I use FindAll I only see the first title, the second I can't find using it's name $UIA_NamePropertyId or FindAll (I know that in this example case the texts are dupes, but I manually edit the HTML and changed them to be unique for testing purpose). Link to comment Share on other sites More sharing options...
junkew Posted September 26, 2021 Share Posted September 26, 2021 Getting an object from a mouse position is allways tricky certainly with html where it can completely be rendered in a "weird" way. Suggestion to use findall with a property true condition so it will find all. Use subtree. Its most likely there as certainly inspect and uiaspy are showing you that. They are just in different parts of the hierarchy. When I use simplespy and create below code I can see it gets dumped (you probably have to set some things in UIA.CFG file) expandcollapse popup;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=UI Automation on W10 - Get all texts in a Chrome document - AutoIt General Help and Support - AutoIt Forums - Google Chrome;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1") ;UI Automation on W10 - Get all texts in a Chrome document - AutoIt General Help and Support - AutoIt Forums - Google Chrome _UIA_setVar("oP2","Title:=UI Automation on W10 - Get all texts in a Chrome document - AutoIt General Help and Support - AutoIt Forums;controltype:=UIA_DocumentControlTypeId;class:=Chrome_RenderWidgetHostHWND") ;UI Automation on W10 - Get all texts in a Chrome document - AutoIt General Help and Support - AutoIt Forums _UIA_setVar("oP3","Title:=;controltype:=UIA_GroupControlTypeId;class:=") ; _UIA_setVar("oP4","Title:=;controltype:=UIA_GroupControlTypeId;class:=") ; _UIA_setVar("oP5","Title:=;controltype:=UIA_TableControlTypeId;class:=") ; _UIA_setVar("oP6","Title:=;controltype:=UIA_GroupControlTypeId;class:=") ; _UIA_setVar("oP7","Title:=;controltype:=UIA_GroupControlTypeId;class:=") ; _UIA_setVar("oP8","Title:=;controltype:=UIA_GroupControlTypeId;class:=") ; ;~ $oUIElement=_UIA_getObjectByFindAll("MarvKLM.mainwindow", "title:=MarvKLM;ControlType:=UIA_HyperlinkControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=UI Automation on W10;index:=4") ;~ Actions split away from logical/technical definition above can come from configfiles _UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") _UIA_Action("oP2","highlight") _UIA_Action("oP2","setfocus") _UIA_Action("oP3","highlight") _UIA_Action("oP3","setfocus") _UIA_Action("oP4","highlight") _UIA_Action("oP4","setfocus") _UIA_Action("oP5","highlight") ;~ _UIA_Action("oP5","setfocus") ;~ _UIA_Action("oP6","highlight") ;~ _UIA_Action("oP6","setfocus") ;~ _UIA_Action("oP7","highlight") ;~ _UIA_Action("oP7","setfocus") ;~_UIA_Action("oP8","highlight") _UIA_Action("oP5","dumpthemall") _UIA_action("oUIElement","highlight") ;~_UIA_action("oUIElement","click") FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
junkew Posted September 26, 2021 Share Posted September 26, 2021 You have to find the document not the chrome window Local $pConditionDoc $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_RenderWidgetHostHWND", $pConditionDoc) If Not $pConditionDoc Then Return ConsoleWrite( "$pConditionDoc ERR" & @CRLF ) ConsoleWrite( "$pConditionDoc OK" & @CRLF ) Local $pDocument, $oDocument $oPane1.FindFirst( $TreeScope_Descendants, $pConditionDoc, $pDocument ) $oDocument = ObjCreateInterface( $pDocument, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oDocument ) Then Return ConsoleWrite( "$oDocument ERR" & @CRLF ) ConsoleWrite( "$oDocument OK" & @CRLF ) _UIA_Highlight($oDocument) and then findall on the document $oDocument.FindAll( $TreeScope_Subtree, $pCondition1, $pElements ) My full example (but its based on uiawrappers similar but a little different library) expandcollapse popup;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Example1() Func Example1() ; Create UI Automation object Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement( $pDesktop ) $oDesktop = ObjCreateInterface( $pDesktop, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oDesktop ) Then Return ConsoleWrite( "$oDesktop ERR" & @CRLF ) ConsoleWrite( "$oDesktop OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pPane1, $oPane1 $oDesktop.FindFirst( $TreeScope_Descendants, $pCondition0, $pPane1 ) $oPane1 = ObjCreateInterface( $pPane1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oPane1 ) Then Return ConsoleWrite( "$oPane1 ERR" & @CRLF ) ConsoleWrite( "$oPane1 OK" & @CRLF ) Local $pConditionDoc $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_RenderWidgetHostHWND", $pConditionDoc) If Not $pConditionDoc Then Return ConsoleWrite( "$pConditionDoc ERR" & @CRLF ) ConsoleWrite( "$pConditionDoc OK" & @CRLF ) Local $pDocument, $oDocument $oPane1.FindFirst( $TreeScope_Descendants, $pConditionDoc, $pDocument ) $oDocument = ObjCreateInterface( $pDocument, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oDocument ) Then Return ConsoleWrite( "$oDocument ERR" & @CRLF ) ConsoleWrite( "$oDocument OK" & @CRLF ) _UIA_Highlight($oDocument) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition1 $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_TextControlTypeId, $pCondition1 ) If Not $pCondition1 Then Return ConsoleWrite( "$pCondition1 ERR" & @CRLF ) ConsoleWrite( "$pCondition1 OK" & @CRLF ) #cs Local $pText1, $oText1 $oPane1.FindFirst( $TreeScope_Descendants, $pCondition1, $pText1 ) $oText1 = ObjCreateInterface( $pText1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oText1 ) Then Return ConsoleWrite( "$oText1 ERR" & @CRLF ) ConsoleWrite( "$oText1 OK" & @CRLF ) #ce Local $pElements $oDocument.FindAll( $TreeScope_Subtree, $pCondition1, $pElements ) ; --- Code Snippets --- ConsoleWrite( "--- Code Snippets ---" & @CRLF ) Local $oUIElementArray1, $iLength1 ; $pElements is a pointer to an UI Automation element array $oUIElementArray1 = ObjCreateInterFace( $pElements, $sIID_IUIAutomationElementArray, $dtagIUIAutomationElementArray ) $oUIElementArray1.Length( $iLength1 ) If Not $iLength1 Then Return ConsoleWrite( "$iLength1 = 0 ERR" & @CRLF ) ConsoleWrite( "$iLength1 = " & $iLength1 & @CRLF ) ; --- Code Snippets --- ConsoleWrite( "--- Code Snippets ---" & @CRLF ) Local $pElement1, $oElement1, $sValue1 For $i = 0 To $iLength1 - 1 $oUIElementArray1.GetElement( $i, $pElement1 ) $oElement1 = ObjCreateInterface( $pElement1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) $oElement1.GetCurrentPropertyValue( $UIA_NamePropertyId, $sValue1 ) if stringinstr($sValue1,"UI Automation on W10") > 0 then ConsoleWrite( $i & "$sValue1 = " & $sValue1 & @CRLF ) EndIf Next EndFunc output >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\xxxx\Documents\UIA\uiatest.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop $oUIAutomation OK $oDesktop OK --- Find window/control --- $pCondition0 OK $oPane1 OK $pConditionDoc OK $oDocument OK --- Find window/control --- $pCondition1 OK --- Code Snippets --- $iLength1 = 1188 --- Code Snippets --- 8$sValue1 = UI Automation on W10 - Get all texts in a Chrome document 630$sValue1 = UI Automation on W10 - Get all texts in a Chrome document 632$sValue1 = UI Automation on W10 - Get all texts in a Chrome document 876$sValue1 = "Title:=UI Automation on W10 - Get all texts in a Chrome document - AutoIt General Help and Support - AutoIt Forums - Google Chrome;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1" 918$sValue1 = "Title:=UI Automation on W10 - Get all texts in a Chrome document - AutoIt General Help and Support - AutoIt Forums;controltype:=UIA_DocumentControlTypeId;class:=Chrome_RenderWidgetHostHWND" 1015$sValue1 = "Title:=UI Automation on W10;index:=4" 1185$sValue1 = UI Automation on W10 - Get all texts in a Chrome document +>19:10:38 AutoIt3.exe ended.rc:0 +>19:10:38 AutoIt3Wrapper Finished. >Exit code: 0 Time: 4.689 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
MarvKLM Posted September 26, 2021 Author Share Posted September 26, 2021 Hi @junkew, thanks for taking your time to make a code example. Unfortunately the results on W10 are still the same, does not matter if I use Document or Pane with FindAll. And based on your example output you have the same bug. Look at "8$sValue1 = UI Automation on W10 - Get all texts in a Chrome document" the 9$ should be the next element to be found, right under the first title. Try to change the text manually like the below image and it will be more clear. Another thing, for some reason if I use "$oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_RenderWidgetHostHWND", $pConditionDoc)" I can't find the oDocument (both W7 and W10), also tried $UIA_AutomationIdPropertyId, only $UIA_ControlTypePropertyId with $UIA_DocumentControlTypeId worked. Let me show my outputs using your example, but looking for all texts. You will notice that in W7 both texts are found but not in W10. I suspect that you are having the same problem. W7 output (first 41 Text Elements): Spoiler $oUIAutomation OK $oDesktop OK --- Find window/control --- $pCondition0 OK $oPane1 OK $pConditionDoc OK $oDocument OK --- Find window/control --- $pCondition1 OK --- Code Snippets --- $iLength1 = 1893 --- Code Snippets --- 0$sValue1 = 1$sValue1 = Create 2$sValue1 = 3$sValue1 = 4$sValue1 = 5$sValue1 = MarvKLM 6$sValue1 = 7$sValue1 = Browse 8$sValue1 = Forums 9$sValue1 = Downloads 10$sValue1 = Calendar 11$sValue1 = Forum Rules 12$sValue1 = Staff 13$sValue1 = Leaderboard 14$sValue1 = Activity 15$sValue1 = Wiki 16$sValue1 = Bug Tracker 17$sValue1 = AutoIt Resources 18$sValue1 = 19$sValue1 = FAQ 20$sValue1 = Our Picks 21$sValue1 = 22$sValue1 = Unread Content 23$sValue1 = Mark site read 24$sValue1 = Home 25$sValue1 = 26$sValue1 = AutoIt v3 27$sValue1 = AutoIt Help and Support 28$sValue1 = AutoIt General Help and Support 29$sValue1 = FIRST UNIQUE TEXT30$sValue1 = SECOND UNIQUE TEXT 31$sValue1 = 32$sValue1 = Add Tag 33$sValue1 = By 34$sValue1 = MarvKLM 35$sValue1 = , 36$sValue1 = Monday at 10:57 PM 37$sValue1 = in 38$sValue1 = AutoIt General Help and Support 39$sValue1 = 40$sValue1 = Share 41$sValue1 = W10 output (first 101 Text Elements): Spoiler $oUIAutomation OK $oDesktop OK --- Find window/control --- $pCondition0 OK $oPane1 OK $pConditionDoc OK $oDocument OK --- Find window/control --- $pCondition1 OK --- Code Snippets --- $iLength1 = 1512 --- Code Snippets --- 0$sValue1 = 1$sValue1 = 2$sValue1 = 3$sValue1 = 4$sValue1 = FIRST UNIQUE TEXT 5$sValue1 = By 6$sValue1 = , 7$sValue1 = Monday at 07:57 PM 8$sValue1 = in 9$sValue1 = 10$sValue1 = Followers 11$sValue1 = 2 12$sValue1 = Seeker 13$sValue1 = 14$sValue1 = Members 15$sValue1 = 16$sValue1 = 4 posts 17$sValue1 = 18$sValue1 = Posted 19$sValue1 = Monday at 07:57 PM 20$sValue1 = Hi. I can't figure out why the same below example works for fine for me on W7 but it fails to show all texts in W10. 21$sValue1 = 22$sValue1 = December 1, 2018 23$sValue1 = The GUI looks like shown in the picture: It contains a 24$sValue1 = main menu, a treeview in left pane that lists UI Automation elements, a 25$sValue1 = listview in right pane that displays detail information for the selected element, and a splitterbar to adjust the width of the two panes. Detect element The "Detect element" main menu is used to detect elements under the mouse with function keys F1 - F4. See How to topics number 2. Left pane The left pane is a treeview that initial 26$sValue1 = 19 27$sValue1 = 28$sValue1 = 29$sValue1 = 30$sValue1 = 31$sValue1 = 32$sValue1 = 33$sValue1 = I have searched the forum and Google to see if there is something specific to the new W10 build (20H2) but i couldn't find annything. This is the original example i'm using fine in W7: 34$sValue1 = 35$sValue1 = Reveal hidden contents 36$sValue1 = And then I changed some of the static variables for the W10, but both fails to show all text elements. 37$sValue1 = 38$sValue1 = Reveal hidden contents 39$sValue1 = Things I've tried: #RequireAdmin | No AV | Exec as Adm | Change Chrome compatibility on W10 | 40$sValue1 = On W7, for example, inspecting the top of this page, Browse shows HyperlinkControl and TextControl: 41$sValue1 = Now on W10, there are some changes. Custom Control changes to Group and no text. 42$sValue1 = *I'm using the Browse link here as an example where it shows two controls in W7, my intention is to find all text (TextControl). Using the above snippet there many other plain texts in W10 missing, that shows on W7. Using UIASpy in Chrome - W10, I can see the TextControl of the "missing" elements but I can't find them using the above FindAll method. 43$sValue1 = Universalist 44$sValue1 = MVPs 45$sValue1 = 46$sValue1 = 47$sValue1 = 48$sValue1 = 11 49$sValue1 = 2,673 posts 50$sValue1 = 51$sValue1 = Posted 52$sValue1 = Tuesday at 02:39 PM 53$sValue1 = Check first within chrome (versions, 32/64 bits) 54$sValue1 = Check chrome://accessibility/ and see the trees as you then should see the same in UIA spy 55$sValue1 = Check with inspect.exe as thats the original MS tool for spying uia 56$sValue1 = 57$sValue1 = 1 58$sValue1 = , 59$sValue1 = , 60$sValue1 = The Cool Code Company 61$sValue1 = MVPs 62$sValue1 = 63$sValue1 = 64$sValue1 = 65$sValue1 = 26 66$sValue1 = 1,856 posts 67$sValue1 = 68$sValue1 = Posted 69$sValue1 = Tuesday at 03:47 PM 70$sValue1 = junkew, Have you tried the 3 options for checking things out yourself. In that case, you would have seen that MarvKLM is completely right. The controls are different in Windows 7 and 10. This applies to both UIASpy and Inspect.exe. 71$sValue1 = I've no idea the reason for the differences. I've made a note of the issue and will investigate it further on occasion. But it'll not be right now because I'm working on other projects. 72$sValue1 = , 73$sValue1 = , 74$sValue1 = , 75$sValue1 = , 76$sValue1 = Compiled code: 77$sValue1 = , 78$sValue1 = , 79$sValue1 = Shell menus: 80$sValue1 = 81$sValue1 = , 82$sValue1 = . 83$sValue1 = Shell related: 84$sValue1 = , 85$sValue1 = Graphics related: 86$sValue1 = , 87$sValue1 = , 88$sValue1 = 89$sValue1 = , 90$sValue1 = ListView controls: 91$sValue1 = , 92$sValue1 = , 93$sValue1 = 94$sValue1 = , 95$sValue1 = , 96$sValue1 = ListView controls: 97$sValue1 = 98$sValue1 = , 99$sValue1 = 100$sValue1 = , 101$sValue1 = The second text is never found in W10 (capped to 101 elements so you can see the difference, but in my tests I looped through all of them). If you can, please try to manually edit the HTML and change to make a text that is unique and then try to loop and see if you can find it. Again, many thanks. Link to comment Share on other sites More sharing options...
junkew Posted September 27, 2021 Share Posted September 27, 2021 Try with the true condition (as the html is a span element maybe thats why its not in the list as findall default to check for iscontrol). Otherwise you have to build your own findall based on the rawview treewalker. The information is there otherwise inspect and uia would not see it and all they use are treewalker or findall in the same libraries. .FindAll( $treescope_subtree, $UIA_oTRUECondition, $pUIElementArray ) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
junkew Posted September 27, 2021 Share Posted September 27, 2021 I had no AutoIt by hand so here some analysis with Excel VBA. You seem to be right that FindAll misses some items. It could be you have to change more in the condition given to findall to get more into a rawview finding mode but not sure if thats possible. Findall is based on controlviewwalker. Easiest would be to write your own recursing findall based on the rawviewwalker see below a VBA example * open a new vba module * add references to uiautomationcore * copy paste below and run test function * The gCounter should be equal to number of finds with ctrl f on the webpage Option Explicit Public c As New CUIAutomation8 Public gCounter As Long Sub test() Dim elDesktop As IUIAutomationElement Dim elBrowser As IUIAutomationElement Dim el As IUIAutomationElement Set elDesktop = c.GetRootElement Debug.Print elDesktop.CurrentClassName listChilds elDesktop DoEvents Set elBrowser = getMyBrowser(elDesktop) Debug.Print elBrowser.CurrentName Dim elDocument As IUIAutomationElement Set elDocument = getMyDocument(elBrowser) Debug.Print "Document window: " & elDocument.CurrentName gCounter = 0 listMatched elDocument, TreeScope_Subtree gCounter = 0 listRecurseWalker elDocument End Sub Sub listRecurseWalker(elParent As IUIAutomationElement, Optional scope As TreeScope = TreeScope_Children) Dim tw As IUIAutomationTreeWalker Dim el As IUIAutomationElement Set tw = c.RawViewWalker Set el = tw.GetFirstChildElement(elParent) While Not (el Is Nothing) If InStr(el.CurrentName, "UI Automation on W10") Then gCounter = gCounter + 1 Debug.Print gCounter & " ; " & el.CurrentName & el.CurrentClassName & el.CurrentControlType End If listRecurseWalker el DoEvents Set el = tw.GetNextSiblingElement(el) Wend End Sub Sub listMatched(elParent As IUIAutomationElement, Optional scope As TreeScope = TreeScope_Children) Dim elArr As IUIAutomationElementArray Dim oTrueCondition As IUIAutomationCondition Dim i As Long Dim el As IUIAutomationElement Set oTrueCondition = c.CreateTrueCondition Set elArr = elParent.FindAll(scope, oTrueCondition) Debug.Print "Iterating over " & elArr.Length; " items" For i = 0 To elArr.Length - 1 Set el = elArr.GetElement(i) If InStr(el.CurrentName, "UI Automation on W10 - Get all texts in a Chrome document") > 1 Then gCounter = gCounter + 1 Debug.Print gCounter & " ; "; i & " ; " & el.CurrentControlType & el.CurrentName & " ; " & el.CurrentClassName End If Next End Sub Sub listChilds(elParent As IUIAutomationElement, Optional scope As TreeScope = TreeScope_Children) Dim elArr As IUIAutomationElementArray Dim oTrueCondition As IUIAutomationCondition Dim i As Long Dim el As IUIAutomationElement Set oTrueCondition = c.CreateTrueCondition Set elArr = elParent.FindAll(scope, oTrueCondition) For i = 0 To elArr.Length - 1 Set el = elArr.GetElement(i) 'Debug.Print i & " ; " & el.CurrentName & " ; " & el.CurrentClassName Next End Sub Function getMyBrowser(elParent As IUIAutomationElement, Optional scope As TreeScope = TreeScope_Children) As IUIAutomationElement Dim cond As IUIAutomationCondition Set cond = c.CreatePropertyCondition(UIA_ClassNamePropertyId, "Chrome_WidgetWin_1") 'Set cond = c.CreatePropertyCondition(UIA_NamePropertyId, "Forums - AutoIt Forums - Google Chrome") Set getMyBrowser = elParent.FindFirst(scope, cond) Debug.Print "First matched: " & getMyBrowser.CurrentName Exit Function End Function Function getMyDocument(elParent As IUIAutomationElement, Optional scope As TreeScope = TreeScope_Children) As IUIAutomationElement Dim cond As IUIAutomationCondition Set cond = c.CreatePropertyCondition(UIA_ClassNamePropertyId, "Chrome_RenderWidgetHostHWND") 'Set cond = c.CreatePropertyCondition(UIA_NamePropertyId, "Forums - AutoIt Forums - Google Chrome") Set getMyDocument = elParent.FindFirst(scope, cond) 'Debug.Print "First matched: " & getMyBrowser.CurrentName Exit Function End Function FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
junkew Posted September 27, 2021 Share Posted September 27, 2021 Its definitely not a bug as its a span control it completely depends if the aria attributes are set. You can see this also when you check for IsControlElement. So you should make your own findall based on a rawviewwalker.https://www.w3.org/TR/html-aam-1.0/ UIA: When a labelable element is referenced by a label element's for attribute, or a descendant of a label element, the labelable element's UIA LabeledBy property points to the UIA element for the label element. Elements mapped to the Text Control Type are not generally represented as accessible objects in the accessibility tree, but are just part of the Text Control Pattern implemented for the whole HTML document. However, if they have any aria- attributes or an explicit tabindex specified, elements mapped to the Text Control Type will be represented as accessible objects in the accessibility tree. Decibel 1 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
MarvKLM Posted September 27, 2021 Author Share Posted September 27, 2021 Hi @junkew thank for confirming my suspicious about FindAll. I changed my approach to TreeWalker to find all elements. There are some considerations that you might help me to understand. First the TreeWalker code (from @LarsJ) I'm using: Spoiler expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Opt( "MustDeclareVars", 1 ) #include "UIA_Constants.au3" ; Array index offset relative to UIA_ControlTypeIds = -50000 Global Const $aUIControls = [ _ "Button", "Calendar", "CheckBox", "ComboBox", "Edit", "Hyperlink", "Image", "ListItem", "List", "Menu", _ "MenuBar", "MenuItem", "ProgressBar", "RadioButton", "ScrollBar", "Slider", "Spinner", "StatusBar", "Tab", "TabItem", _ "Text", "ToolBar", "ToolTip", "Tree", "TreeItem", "Custom", "Group", "Thumb", "DataGrid", "DataItem", _ "Document", "SplitButton", "Window", "Pane", "Header", "HeaderItem", "Table", "TitleBar", "Separator", "SemanticZoom", _ "AppBar" ] Global $oUIAutomation, $sTemp Example2() Func Example1() ; Create UI Automation object $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtag_IUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement( $pDesktop ) $oDesktop = ObjCreateInterface( $pDesktop, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oDesktop ) Then Return ConsoleWrite( "$oDesktop ERR" & @CRLF ) ConsoleWrite( "$oDesktop OK" & @CRLF ) ; Chrome condition Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) ; Find pane control Local $pPane1, $oPane1 $oDesktop.FindFirst( $TreeScope_Children, $pCondition0, $pPane1 ) $oPane1 = ObjCreateInterface( $pPane1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oPane1 ) Then Return ConsoleWrite( "$oPane1 ERR" & @CRLF ) ConsoleWrite( "$oPane1 OK" & @CRLF & @CRLF ) Local $pConditionDoc ;~ $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_DocumentControlTypeId, $pConditionDoc ) $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_RenderWidgetHostHWND", $pConditionDoc) If Not $pConditionDoc Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pDocument, $oDocument $oPane1.FindFirst( $TreeScope_Descendants, $pConditionDoc, $pDocument ) $oDocument = ObjCreateInterface( $pDocument, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oDocument ) Then Return ConsoleWrite( "$oDocument ERR" & @CRLF ) ConsoleWrite( "$oDocument OK" & @CRLF ) ; List all automation elements of a window ; in a hierarchical structure like a treeview. ListDescendants( $oDocument ) EndFunc ; List all child elements of parent Func ListDescendants( $oParent, $iLevels = 0, $iLevel = 0 ) If Not IsObj( $oParent ) Then Return If $iLevels And $iLevel = $iLevels Then Return ; Create RawViewWalker object Local $pRawViewWalker, $oRawViewWalker $oUIAutomation.RawViewWalker( $pRawViewWalker ) $oRawViewWalker = ObjCreateInterface( $pRawViewWalker, $sIID_IUIAutomationTreeWalker, $dtag_IUIAutomationTreeWalker ) If Not IsObj( $oRawViewWalker ) Then Return ConsoleWrite( "$oRawViewWalker ERR" & @CRLF ) ; Get first child element Local $pUIElement, $oUIElement $oRawViewWalker.GetFirstChildElement( $oParent, $pUIElement ) $oUIElement = ObjCreateInterface( $pUIElement, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) Local $iControl, $sElement While IsObj( $oUIElement ) $oUIElement.GetCurrentPropertyValue( $UIA_ControlTypePropertyId, $iControl ) $oUIElement.GetCurrentPropertyValue( $UIA_NamePropertyId, $sElement ) If $aUIControls[$iControl-50000] = "Text" Then ConsoleWrite($sElement & @CRLF ) EndIf ListDescendants( $oUIElement, $iLevels, $iLevel + 1 ) $oRawViewWalker.GetNextSiblingElement( $oUIElement, $pUIElement ) $oUIElement = ObjCreateInterface( $pUIElement, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) WEnd EndFunc 1 - Consideration on Pane and Document: W7 - FindAll and TreeWalker both works to find all elements using Pane or Document, results are the same when retrieving Document elements. W10 - FindAll works with Pane and Document but fails to find all elements (because of the aria attributes?). TreeWalker only works with Document, if you use Pane the elements in Document are not retrieved (not sure if this should be the correct method, where Pane only shows PaneElements, but in this case Document is also a child of Pane). 2 - Consideration about the CreatePropertyCondition to find the Document: $UIA_ClassNamePropertyId - Chrome_RenderWidgetHostHWND - using these properties to find the Document (both in W7 Chrome and W10 Chrome) will fail if the Document is not on focus. $UIA_ControlTypePropertyId - $UIA_DocumentControlTypeId - using these properties to find the Document (both in W7 Chrome and W10 Edge) works without the Document being on focus, but this fails on Chrome without focus. I could not find the reason that Document object fails on W10 Chrome if it's not on focus. Using TreeWalker I was able to find the text elements but you will see that in W10, Chrome and Edge have some interesting differences: W7 output: Spoiler $oUIAutomation OK $oDesktop OK $pCondition0 OK $oPane1 OK Existing user? Sign In Sign Up Browse Forums Downloads CalendarForum Rules Wiki AutoIt Resources FAQ Our Picks All Activity Home AutoIt v3 AutoIt Help and Support AutoIt General Help and Support FIRST UNIQUE TEXT SECOND UNIQUE TEXT By MarvKLM , September 20 in AutoIt General Help and Support Share Followers 2 MarvKLM Seeker Members 0 5 posts W10 Chrome output: Spoiler FIRST UNIQUE TEXT SECOND UNIQUE TEXT By , September 20 in Followers 2 MarvKLM Seeker Members 5 posts Posted September 20 Hi. I can't figure out why the same below example works for fine for me on W7 but it fails to show all texts in W10. December 1, 2018 The GUI looks like shown in the picture: It contains a main menu, a treeview in left pane that lists UI Automation elements, a listview in right pane that displays detail information for the selected element, and a splitterbar to adjust the width of the two panes. Detect element The "Detect element" main menu is used to detect elements under the mouse with function keys F1 - F4. See How to topics number 2. Left pane The left pane is a treeview that initial 19 W10 Edge output: Spoiler Existing user? Sign In Sign Up Browse Forums Downloads CalendarForum Rules Wiki AutoIt Resources FAQ Our Picks All Activity Home AutoIt v3 AutoIt Help and Support AutoIt General Help and Support FIRST UNIQUE TEXT AliExpress agora no Brasil Venha vender com uma das marcas mais confiáveis de e-commerce internacional no Brasil-2020 AliExpress AbrirSECOND UNIQUE TEXT By MarvKLM , 09/20/2021 07:57 PM September 20 in AutoIt General Help and Support Share Followers 2 MarvKLM MarvKLM As you can see TreeWalker in W10 Edge shows similar results to W7 Chrome. Link to comment Share on other sites More sharing options...
junkew Posted September 27, 2021 Share Posted September 27, 2021 When you change your unique text from <span> to <li> you will see its seen by findall Different operating system = different tree Different browsers = different tree Different browser = different versions of chromium In general different versions lead to different trees which you should test properly what your objective is. If you just want to get the innerText or innerHTML send below into the addressbar with sendkeys and followed by a return. Would then be easy to get from the popup javascript:alert(document.body.innerText);void(0); javascript:alert(document.body.innerHTML);void(0); above you also can do less visible by adding a textbox of size 1x1 to the webpage and then getyour textbox with regular uia functions javascript:{const input = document.createElement("input");input.setAttribute("type", "text");document.body.appendChild(input);input.value = document.body.innerText;void(0);} FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now