Jump to content

IUIAutomation MS framework automate chrome, FF, IE, ....


junkew
 Share

Recommended Posts

  • Developers
6 hours ago, poisonkiller said:

I am hopping here from AHK forums

...and you are used to crosspost your question at multiple plac s in a forum?...  Why exactly?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

9 hours ago, Jos said:

...and you are used to crosspost your question at multiple plac s in a forum?...  Why exactly?

Although this discussion feels more like belonging to a PM, I'll answer publicly (since you did):

1) I first contacted the author of this thread and he recommended I post my question here on the forums

2) "are used to" is very incorrect, since this is the first time.

3) The why... UIAutomation is a rather niche topic, and interacting with it through COM even moreso. Most of the Google results about UIAutomation contain at least some links to this forum, and the userbase for UIAutomation is much larger here, and has years more experience with it. My question is also quite niche, and hours of Googling hasn't resulted in anything. If there is any place to at least hope to get an answer, I think it would be here.

 

To not get totally offtopic, here is my current workaround to get access to Skype and other Chromium-based apps: after activating the window with WinActivate(), get an element from inside the content with either UIA GetFocusedElement or ElementFromPoint. Then use a condition for ControlType:=Document to create a TreeWalker and use that TreeWalker's NormalizeElement method to get the Document element, which contains all the Chromium content. The other elements of the window (for example minmax buttons) you can get with the regular ElementFromHandle. Although this is a hacky workaround, at least it works... But a ElementFromHandle approach would be preferrable, and the question still remains that why is there a disconnect between Skype window element and the Chromium Document element.

Edited by poisonkiller
Link to comment
Share on other sites

I am not using skype so hard to say but use the raw uia examples and not the wrapper.

But as it seems you have more then enough knowledge on how to run this lets see the basic steps

Me and @LarsJ https://www.autoitscript.com/forum/search/?&q=iuiautomation&type=forums_topic&author=LarsJ&nodes=9&search_and_or=and&sortby=relevancy

have written a lot of stuff and it boils down when you have questions "I cannot find my object"

* whats inspect.exe giving you back

* whats simplespy giving you back

* whats uiaspy giving you back https://www.autoitscript.com/forum/topic/196833-uiaspy-ui-automation-spy-tool/?tab=comments#comment-1411655

If any of above shows your object we should be able to find it 😉 

if inspect.exe is not showing it it makes sense to report an issue to the chromium team they have fixed issues for me in the past. 

Looking at chrome://accessibility/ there is some configuration possible but I would not know how to do that on skype/electron apps

maybe FindContainerWindowElement gives a different answer 

I can only guess but advice is just to use your workaround there are so many glitches anyway in automation that sometimes its not worth the effort to find the rootcause of an issue if the workaround is fine

Link to comment
Share on other sites

I am not using uia, but to get all child elements with iaccessible for some chrominium applications like vivaldi or skype You need first call accName of iaccessible object, after that wait some time for appearing childs.

As example autohotkey code:

if !init
{
   SendMessage, WM_GETOBJECT := 0x003D, 0, 1, Chrome_RenderWidgetHostHWND1, A
   Acc := Acc_ObjectFromPoint(child)
   Acc.accName(child)
   sleep 300
   init := 1
}
Acc := Acc_ObjectFromPoint(child)
MsgBox, % Acc.accRole(child)
Return

 

Link to comment
Share on other sites

@junkew, thanks, I'll slowly start going through all the links you have provided (especially the chromium accessibility source seems quite interesting). But it it seeming more and more likely that this is just a bug in Chromium or UIA... I think I'll read the Chromium accessibility source code and if it doesn't reveal anything, then I'll report a bug.

@malcev, thank you for the suggestion, but in this case it doesn't seem to be relevant. After using MSAA ObjectFromPoint doesn't change the UIA tree, neither after your example nor inspecting with inspect.exe in MSAA mode (which should be calling both ObjectFromPoint and getting roles/names).

As a side-note, the Sleep 300 might sometimes not be enough, since my tests have shown that some windows take a very short time to enable MSAA/UIA trees, but others might take >300ms (especially windows with thousands of elements, like Chrome with a very complex website open). In UIA you can dynamically wait for the tree be constructed by sending the SendMessage signal, then find the element in the window for ClassName:=Chrome_RendererWidgetHostHWND, get the CurrentName (this part is important, otherwise ValuePattern ValueValueProperty is not accessible) and then wait for ValueValueProperty to have a value (which is usually an URL).

Link to comment
Share on other sites

300ms - it is just an example.

You can test like this.

Exit all uia inspectors, exit skype, run skype, run AccExplorer32.

https://github.com/blackrosezy/gui-inspect-tool/blob/master/AccExplorer32.exe

Choose skype window, build tree with this utility -> as result You will see that Your tree will not have all child elements.

Then run ahk code, activate skype, press f11.

f11::
SendMessage, WM_GETOBJECT := 0x003D, 0, 1, Chrome_RenderWidgetHostHWND1, A
Acc := Acc_ObjectFromWindow(WinExist("A"))
Acc.accName(0)
Return


; http://www.autohotkey.com/board/topic/77303-acc-library-ahk-l-updated-09272012/
; https://dl.dropbox.com/u/47573473/Web%20Server/AHK_L/Acc.ahk
;------------------------------------------------------------------------------
; Acc.ahk Standard Library
; by Sean
; Updated by jethrow:
;   Modified ComObjEnwrap params from (9,pacc) --> (9,pacc,1)
;   Changed ComObjUnwrap to ComObjValue in order to avoid AddRef (thanks fincs)
;   Added Acc_GetRoleText & Acc_GetStateText
;   Added additional functions - commented below
;   Removed original Acc_Children function
; last updated 2/25/2010
;------------------------------------------------------------------------------

Acc_Init()
{
    Static  h
    If Not  h
        h:=DllCall("LoadLibrary","Str","oleacc","Ptr")
}
Acc_ObjectFromEvent(ByRef _idChild_, hWnd, idObject, idChild)
{
    Acc_Init()
    If  DllCall("oleacc\AccessibleObjectFromEvent", "Ptr", hWnd, "UInt", idObject, "UInt", idChild, "Ptr*", pacc, "Ptr", VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&varChild)=0
    Return  ComObjEnwrap(9,pacc,1), _idChild_:=NumGet(varChild,8,"UInt")
}

Acc_ObjectFromPoint(ByRef _idChild_ = "", x = "", y = "")
{
    Acc_Init()
    If  DllCall("oleacc\AccessibleObjectFromPoint", "Int64", x==""||y==""?0*DllCall("GetCursorPos","Int64*",pt)+pt:x&0xFFFFFFFF|y<<32, "Ptr*", pacc, "Ptr", VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&varChild)=0
    Return  ComObjEnwrap(9,pacc,1), _idChild_:=NumGet(varChild,8,"UInt")
}

Acc_ObjectFromWindow(hWnd, idObject = -4)
{
    Acc_Init()
    If  DllCall("oleacc\AccessibleObjectFromWindow", "Ptr", hWnd, "UInt", idObject&=0xFFFFFFFF, "Ptr", -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,"Int64"),"Int64"), "Ptr*", pacc)=0
    Return  ComObjEnwrap(9,pacc,1)
}

Acc_WindowFromObject(pacc)
{
    If  DllCall("oleacc\WindowFromAccessibleObject", "Ptr", IsObject(pacc)?ComObjValue(pacc):pacc, "Ptr*", hWnd)=0
    Return  hWnd
}

Acc_GetRoleText(nRole)
{
    nSize := DllCall("oleacc\GetRoleText", "Uint", nRole, "Ptr", 0, "Uint", 0)
    VarSetCapacity(sRole, (A_IsUnicode?2:1)*nSize)
    DllCall("oleacc\GetRoleText", "Uint", nRole, "str", sRole, "Uint", nSize+1)
    Return  sRole
}

Acc_GetStateText(nState)
{
    nSize := DllCall("oleacc\GetStateText", "Uint", nState, "Ptr", 0, "Uint", 0)
    VarSetCapacity(sState, (A_IsUnicode?2:1)*nSize)
    DllCall("oleacc\GetStateText", "Uint", nState, "str", sState, "Uint", nSize+1)
    Return  sState
}

Acc_SetWinEventHook(eventMin, eventMax, pCallback)
{
    Return  DllCall("SetWinEventHook", "Uint", eventMin, "Uint", eventMax, "Uint", 0, "Ptr", pCallback, "Uint", 0, "Uint", 0, "Uint", 0)
}

Acc_UnhookWinEvent(hHook)
{
    Return  DllCall("UnhookWinEvent", "Ptr", hHook)
}
/*  Win Events:
    pCallback := RegisterCallback("WinEventProc")
    WinEventProc(hHook, event, hWnd, idObject, idChild, eventThread, eventTime)
    {
        Critical
        Acc := Acc_ObjectFromEvent(_idChild_, hWnd, idObject, idChild)
        ; Code Here:
    }
*/

; Written by jethrow
Acc_Role(Acc, ChildId=0) {
    try return ComObjType(Acc,"Name")="IAccessible"?Acc_GetRoleText(Acc.accRole(ChildId)):"invalid object"
}
Acc_State(Acc, ChildId=0) {
    try return ComObjType(Acc,"Name")="IAccessible"?Acc_GetStateText(Acc.accState(ChildId)):"invalid object"
}
Acc_Location(Acc, ChildId=0, byref Position="") { ; adapted from Sean's code
    try Acc.accLocation(ComObj(0x4003,&x:=0), ComObj(0x4003,&y:=0), ComObj(0x4003,&w:=0), ComObj(0x4003,&h:=0), ChildId)
    catch
        return
    Position := "x" NumGet(x,0,"int") " y" NumGet(y,0,"int") " w" NumGet(w,0,"int") " h" NumGet(h,0,"int")
    return  {x:NumGet(x,0,"int"), y:NumGet(y,0,"int"), w:NumGet(w,0,"int"), h:NumGet(h,0,"int")}
}
Acc_Parent(Acc) { 
    try parent:=Acc.accParent
    return parent?Acc_Query(parent):
}
Acc_Child(Acc, ChildId=0) {
    try child:=Acc.accChild(ChildId)
    return child?Acc_Query(child):
}
Acc_Query(Acc) { ; thanks Lexikos - www.autohotkey.com/forum/viewtopic.php?t=81731&p=509530#509530
    try return ComObj(9, ComObjQuery(Acc,"{618736e0-3c3d-11cf-810c-00aa00389b71}"), 1)
}
Acc_Error(p="") {
    static setting:=0
    return p=""?setting:setting:=p
}
Acc_Children(Acc) {
    if ComObjType(Acc,"Name") != "IAccessible"
        ErrorLevel := "Invalid IAccessible Object"
    else {
        Acc_Init(), cChildren:=Acc.accChildCount, Children:=[]
        if DllCall("oleacc\AccessibleChildren", "Ptr",ComObjValue(Acc), "Int",0, "Int",cChildren, "Ptr",VarSetCapacity(varChildren,cChildren*(8+2*A_PtrSize),0)*0+&varChildren, "Int*",cChildren)=0 {
            Loop %cChildren%
                i:=(A_Index-1)*(A_PtrSize*2+8)+8, child:=NumGet(varChildren,i), Children.Insert(NumGet(varChildren,i-8)=9?Acc_Query(child):child), NumGet(varChildren,i-8)=9?ObjRelease(child):
            return Children.MaxIndex()?Children:
        } else
            ErrorLevel := "AccessibleChildren DllCall Failed"
    }
    if Acc_Error()
        throw Exception(ErrorLevel,-1)
}
Acc_ChildrenByRole(Acc, Role) {
    if ComObjType(Acc,"Name")!="IAccessible"
        ErrorLevel := "Invalid IAccessible Object"
    else {
        Acc_Init(), cChildren:=Acc.accChildCount, Children:=[]
        if DllCall("oleacc\AccessibleChildren", "Ptr",ComObjValue(Acc), "Int",0, "Int",cChildren, "Ptr",VarSetCapacity(varChildren,cChildren*(8+2*A_PtrSize),0)*0+&varChildren, "Int*",cChildren)=0 {
            Loop %cChildren% {
                i:=(A_Index-1)*(A_PtrSize*2+8)+8, child:=NumGet(varChildren,i)
                if NumGet(varChildren,i-8)=9
                    AccChild:=Acc_Query(child), ObjRelease(child), Acc_Role(AccChild)=Role?Children.Insert(AccChild):
                else
                    Acc_Role(Acc, child)=Role?Children.Insert(child):
            }
            return Children.MaxIndex()?Children:, ErrorLevel:=0
        } else
            ErrorLevel := "AccessibleChildren DllCall Failed"
    }
    if Acc_Error()
        throw Exception(ErrorLevel,-1)
}
Acc_Get(Cmd, ChildPath="", ChildID=0, WinTitle="", WinText="", ExcludeTitle="", ExcludeText="") {
    static properties := {Action:"DefaultAction", DoAction:"DoDefaultAction", Keyboard:"KeyboardShortcut"}
    AccObj :=   IsObject(WinTitle)? WinTitle
            :   Acc_ObjectFromWindow( WinExist(WinTitle, WinText, ExcludeTitle, ExcludeText), 0 )
    if ComObjType(AccObj, "Name") != "IAccessible"
        ErrorLevel := "Could not access an IAccessible Object"
    else {
        StringReplace, ChildPath, ChildPath, _, %A_Space%, All
        AccError:=Acc_Error(), Acc_Error(true)
        Loop Parse, ChildPath, ., %A_Space%
            try {
                if A_LoopField is digit
                    Children:=Acc_Children(AccObj), m2:=A_LoopField ; mimic "m2" output in else-statement
                else
                    RegExMatch(A_LoopField, "(\D*)(\d*)", m), Children:=Acc_ChildrenByRole(AccObj, m1), m2:=(m2?m2:1)
                if Not Children.HasKey(m2)
                    throw
                AccObj := Children[m2]
            } catch {
                ErrorLevel:="Cannot access ChildPath Item #" A_Index " -> " A_LoopField, Acc_Error(AccError)
                if Acc_Error()
                    throw Exception("Cannot access ChildPath Item", -1, "Item #" A_Index " -> " A_LoopField)
                return
            }
        Acc_Error(AccError)
        StringReplace, Cmd, Cmd, %A_Space%, , All
        properties.HasKey(Cmd)? Cmd:=properties[Cmd]:
        try {
            if (Cmd = "Location")
                AccObj.accLocation(ComObj(0x4003,&x:=0), ComObj(0x4003,&y:=0), ComObj(0x4003,&w:=0), ComObj(0x4003,&h:=0), ChildId)
              , ret_val := "x" NumGet(x,0,"int") " y" NumGet(y,0,"int") " w" NumGet(w,0,"int") " h" NumGet(h,0,"int")
            else if (Cmd = "Object")
                ret_val := AccObj
            else if Cmd in Role,State
                ret_val := Acc_%Cmd%(AccObj, ChildID+0)
            else if Cmd in ChildCount,Selection,Focus
                ret_val := AccObj["acc" Cmd]
            else
                ret_val := AccObj["acc" Cmd](ChildID+0)
        } catch {
            ErrorLevel := """" Cmd """ Cmd Not Implemented"
            if Acc_Error()
                throw Exception("Cmd Not Implemented", -1, Cmd)
            return
        }
        return ret_val, ErrorLevel:=0
    }
    if Acc_Error()
        throw Exception(ErrorLevel,-1)
}

Activate AccExplorer32, rebuild tree.

As result You will see that tree has all child elements.

Link to comment
Share on other sites

Hi, I have 2 chrome windows/tabs that have the same title but different adresses.

I want to get this 2 tabs and iterate to find who has the correct addressbar to do some stuff in it.

There's a way to get 2 or more windows and find things inside them?

 

I thought in using something like:

Local $pid = Run(<chrome stuff>)

and finding using:

Local $oElement =  _UIA_getObjectByFindAll($UIA_oDesktop,  "ProcessId:=" &  $pid,  $treescope_children)

 

But this is only working if I have no prior chrome windows opened, but I need to not fiddle with the other chrome tabs, and find this new instance and do stuff there.

Edited by Onolox
Link to comment
Share on other sites

First step is to see what the spying tools are spying.

Find the main windows

Iterate the childcontrols or do a findall and iterate them and dump your proporties.

Please make a reproducer script if you want help. Unfortunately it can be yoa have to send refresh Keys or send specific action before your accessibility tree is shown. If not you have to fallback to pixel or ocr recognition.

Link to comment
Share on other sites

  • 4 weeks later...

I'm having troubles in a dual monitor setup, if the window open in the second monitor I can find it but I can't operate over it, focus() for example trows an error "requested action with this object failed".

For some reason after many hours now it started working 🤷‍♂️ ,  only after I posted here...

 

This post can be deleted.

Edited by Onolox
Link to comment
Share on other sites

  • 2 months later...

Is it possible to _UIA_getObjectByFindAll($UIA_oDesktop...) and except my script window from search? My window has a lot of element and uia takes a lot of time to parse all running desktop windows if my is running too. The delay occurs when $UIA_oUIElement.FindAll executed inside _UIA_getObjectByFindAll

Link to comment
Share on other sites

  • 1 month later...

@junkew
Hi, i am very new to autoit, i want to know the ranking of my websites by sending commands in background in chrome browser. I studied a few topics and realized that I can only do this with your library.
Could you please tell me for example how to google search with chrome and find my own website among them?

What I want to do:
8k8ohl4.png

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Hello, great library btw but quick question.

Having an interesting problem(Or really trivial and i've missed some documentation somewhere 😁) where more elements are found in Windows server 2016 07 whereas on Windows 10 pro (19045.2486) its much less. The simplespy tool also cannot "see" the same elements on windows pro.

What could be causing this? Are certain libraries or dll's missing on Windows Professional 19045.2486????. 

Screenshot of same script outputting IUI log file:

Windows Server:

<?xml version="1.0" encoding="UTF-8"?>

-<log space="preserve">


-<logline timestamp="20230301-145443857" level="5">

<information> Information _UIA_VersionInfo version: T0.7-0; Release date: 20190501; OS Version: WIN_2016</information>

</logline>

<logline timestamp="20230301-145447987" level="5"> _UIA_normalizeExpression regexptitle:=Google Chrome;class:=Chrome_WidgetWin_1;elements 1-2 in properties array</logline>

<logline timestamp="20230301-145447987" level="5"> _UIA_normalizeExpression property 1 regexptitle:=Google Chrome</logline>

<logline timestamp="20230301-145447987" level="5"> name:[regexptitle] value:[Google Chrome] having index 5</logline>

<logline timestamp="20230301-145447987" level="5"> _UIA_normalizeExpression property 2 class:=Chrome_WidgetWin_1</logline>

<logline timestamp="20230301-145447987" level="5"> name:[class] value:[Chrome_WidgetWin_1] having index 6</logline>

<logline timestamp="20230301-145447987" level="5"> *** Try to get a list of elements *** treescopetype:=2</logline>

<logline timestamp="20230301-145448126" level="0"> _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 10</logline>

<logline timestamp="20230301-145448137" level="5"> Found match with element: 2 the Name is: <Title is: <- https://XXXXXX - Google Chrome> Class := <Chrome_WidgetWin_1> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) rect := < 487;30;945;1020> hwnd := < 132548> acceleratorkey := < > automationid := <> </logline>


-<logline timestamp="20230301-145448137" level="5">

<propertymatching/>

</logline>

<logline timestamp="20230301-145448138" level="5"> Storing parent for found object in RTI as RTI.PARENT Desktop</logline>

<logline timestamp="20230301-145449019" level="0"> </logline>

<logline timestamp="20230301-145451308" level="0"> Finding object (bypassing repository) with physical description controltype:=Document:controltype:=Document _UIA_action: No RTI.LASTELEMENT used for controltype:=Document _UIA_action: Finding object 1 controltype:=Document object a:=0 under RTI.PARENT object b:=1looking for <controltype:=Document> _UIA_normalizeExpression controltype:=Document;elements 1-1 in properties array_UIA_normalizeExpression property 1 controltype:=Documentname:[controltype] value:[50030] having index 15 *** Try to get a list of elements *** treescopetype:=2 _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 10<propertymatching></propertymatching> deep find in subtree controltype:=Document _UIA_normalizeExpression controltype:=Document;elements 1-1 in properties array_UIA_normalizeExpression property 1 controltype:=Documentname:[controltype] value:[50030] having index 15 *** Try to get a list of elements *** treescopetype:=7 _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 1577Found match with element: 19 the Name is: <Title is: <- https://XXXXXX> Class := <Chrome_RenderWidgetHostHWND> controltype:= <UIA_DocumentControlTypeId> ,<50030> , (0000C36E) rect := < 0;71;1920;969> hwnd := < 1311846> acceleratorkey := < > automationid := <1053722496> <propertymatching></propertymatching>Storing parent for found object in RTI as RTI.PARENT - https://XXXXXX - Google Chrome <action>Action 1 object on controltype:=Document _UIA_IsElement:=1 Parameters 1:=0 2:=0 3:=0 4:=0</action></logline>

<logline timestamp="20230301-145451308" level="0"> </logline>

<logline timestamp="20230301-145451308" level="0"> Quickly referenced object : <action>Action 2 setfocus on _UIA_IsElement:=1 Parameters 1:=0 2:=0 3:=0 4:=0</action></logline>

<logline timestamp="20230301-145452561" level="5"> Matching controltype transformed to propertynumber: 30003: for having value 50030</logline>

<logline timestamp="20230301-145452561" level="5"> UIA found the element</logline>

<logline timestamp="20230301-145452877" level="5"> _UIA_normalizeExpression title:=XXXXX;elements 1-1 in properties array</logline>

<logline timestamp="20230301-145452877" level="5"> _UIA_normalizeExpression property 1 title:=XXXX</logline>

<logline timestamp="20230301-145452877" level="5"> name:[title] value:[XXXX] having index 3</logline>

<logline timestamp="20230301-145452877" level="5"> *** Try to get a list of elements *** treescopetype:=7</logline>

<logline timestamp="20230301-145452946" level="0"> _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 431</logline>

<logline timestamp="20230301-145453895" level="5"> Found match with element: 198 the Name is: <Title is: <XXXX> Class := <> controltype:= <UIA_GroupControlTypeId> ,<50026> , (0000C36A) rect := < 676;117;568;28> hwnd := < 0> acceleratorkey := < > automationid := <> </logline>


-<logline timestamp="20230301-145453895" level="5">

<propertymatching/>

</logline>

<logline timestamp="20230301-145453895" level="5"> Storing parent for found object in RTI as RTI.PARENT </logline>

<logline timestamp="20230301-145454285" level="5"> _UIA_normalizeExpression Title:=XXXX;controltype:=UIA_DocumentControlTypeId;elements 1-2 in properties array</logline>

<logline timestamp="20230301-145454285" level="5"> _UIA_normalizeExpression property 1 Title:=XXXX</logline>

<logline timestamp="20230301-145454285" level="5"> name:[Title] value:[XXXX] having index 3</logline>

<logline timestamp="20230301-145454285" level="5"> _UIA_normalizeExpression property 2 controltype:=UIA_DocumentControlTypeId</logline>

<logline timestamp="20230301-145454285" level="5"> name:[controltype] value:[50030] having index 15</logline>

<logline timestamp="20230301-145454285" level="5"> *** Try to get a list of elements *** treescopetype:=7</logline>

<logline timestamp="20230301-145454332" level="0"> _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 431</logline>

<logline timestamp="20230301-145455283" level="5"> Found match with element: 202 the Name is: <Title is: <XXXX> Class := <> controltype:= <UIA_DocumentControlTypeId> ,<50030> , (0000C36E) rect := < 683;181;546;497> hwnd := < 0> acceleratorkey := < > automationid := <> </logline>


-<logline timestamp="20230301-145455283" level="5">

<propertymatching/>

</logline>

<logline timestamp="20230301-145455283" level="5"> Storing parent for found object in RTI as RTI.PARENT </logline>

<logline timestamp="20230301-145455683" level="0"> </logline>

<logline timestamp="20230301-145455698" level="0"> Quickly referenced object : <action>Action 3 focus on _UIA_IsElement:=1 Parameters 1:=0 2:=0 3:=0 4:=0</action></logline>

<logline timestamp="20230301-145456215" level="5"> _UIA_normalizeExpression name:=XXXX;elements 1-1 in properties array</logline>

<logline timestamp="20230301-145456215" level="5"> _UIA_normalizeExpression property 1 name:=XXXX</logline>

<logline timestamp="20230301-145456215" level="5"> name:[name] value:[XXXX] having index 17</logline>

<logline timestamp="20230301-145456215" level="5"> *** Try to get a list of elements *** treescopetype:=7</logline>

<logline timestamp="20230301-145456268" level="0"> _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 431</logline>

<logline timestamp="20230301-145457428" level="5"> Found match with element: 217 the Name is: <Title is: <XXXX> Class := <> controltype:= <UIA_TextControlTypeId> ,<50020> , (0000C364) rect := < 713;272;83;19> hwnd := < 0> acceleratorkey := < > automationid := <> </logline>


-<logline timestamp="20230301-145457428" level="5">

<propertymatching/>

</logline>

<logline timestamp="20230301-145457432" level="5"> Storing parent for found object in RTI as RTI.PARENT </logline>

<logline timestamp="20230301-145457846" level="0"> </logline>

<logline timestamp="20230301-145457846" level="0"> Quickly referenced object : <action>Action 4 leftclick on _UIA_IsElement:=1 Parameters 1:=0 2:=0 3:=0 4:=XXXX</action></logline>

<logline timestamp="20230301-145458140" level="0"> </logline>

<logline timestamp="20230301-145458143" level="0"> Quickly referenced object : <action>Action 5 setvalue using keys on _UIA_IsElement:=1 Parameters 1:=XXXX 2:=0 3:=0 4:=0</action></logline>

<logline timestamp="20230301-145500485" level="0"> </logline>

<logline timestamp="20230301-145500487" level="0"> Quickly referenced object : <action>Action 6 setvalue using keys on _UIA_IsElement:=1 Parameters 1:={XXXX}XXXX 2:=0 3:=0 4:=0</action></logline>

<logline timestamp="20230301-145501592" level="0"> </logline>

<logline timestamp="20230301-145501592" level="0"> Quickly referenced object : <action>Action 7 setvalue using keys on _UIA_IsElement:=1 Parameters 1:={XXXX}XXXX 2:=0 3:=0 4:=0</action></logline>

<logline timestamp="20230301-145502541" level="0"> </logline>

<logline timestamp="20230301-145502543" level="0"> Quickly referenced object : <action>Action 8 setvalue using keys on _UIA_IsElement:=1 Parameters 1:={XXXX}{XXXX}XXXX{XXXX}{XXXX} 2:=0 3:=0 4:=0</action></logline>

</log>

Windows Pro:

 

<?xml version="1.0" encoding="UTF-8"?>

-<log space="preserve">


-<logline timestamp="20230301-102829126" level="5">

<information> Information _UIA_VersionInfo version: T0.7-0; Release date: 20190501; OS Version: WIN_10</information>

</logline>

<logline timestamp="20230301-102833311" level="5"> _UIA_normalizeExpression regexptitle:=Google Chrome;class:=Chrome_WidgetWin_1;elements 1-2 in properties array</logline>

<logline timestamp="20230301-102833311" level="5"> _UIA_normalizeExpression property 1 regexptitle:=Google Chrome</logline>

<logline timestamp="20230301-102833311" level="5"> name:[regexptitle] value:[Google Chrome] having index 5</logline>

<logline timestamp="20230301-102833311" level="5"> _UIA_normalizeExpression property 2 class:=Chrome_WidgetWin_1</logline>

<logline timestamp="20230301-102833311" level="5"> name:[class] value:[Chrome_WidgetWin_1] having index 6</logline>

<logline timestamp="20230301-102833311" level="5"> *** Try to get a list of elements *** treescopetype:=2</logline>

<logline timestamp="20230301-102833875" level="0"> _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 7</logline>

<logline timestamp="20230301-102833952" level="5"> Found match with element: 2 the Name is: <Title is: <- XXXX> Class := <Chrome_WidgetWin_1> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) rect := < 487;176;945;728> hwnd := < 66234> acceleratorkey := < > automationid := <> </logline>


-<logline timestamp="20230301-102833952" level="5">

<propertymatching/>

</logline>

<logline timestamp="20230301-102833968" level="5"> Storing parent for found object in RTI as RTI.PARENT Desktop 1</logline>

<logline timestamp="20230301-102834607" level="0"> </logline>

<logline timestamp="20230301-102836813" level="0"> Finding object (bypassing repository) with physical description controltype:=Document:controltype:=Document _UIA_action: No RTI.LASTELEMENT used for controltype:=Document _UIA_action: Finding object 1 controltype:=Document object a:=0 under RTI.PARENT object b:=1looking for <controltype:=Document> _UIA_normalizeExpression controltype:=Document;elements 1-1 in properties array_UIA_normalizeExpression property 1 controltype:=Documentname:[controltype] value:[50030] having index 15 *** Try to get a list of elements *** treescopetype:=2 _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 7<propertymatching></propertymatching> deep find in subtree controltype:=Document _UIA_normalizeExpression controltype:=Document;elements 1-1 in properties array_UIA_normalizeExpression property 1 controltype:=Documentname:[controltype] value:[50030] having index 15 *** Try to get a list of elements *** treescopetype:=7 _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 423Found match with element: 12 the Name is: <Title is: <- XXXX> Class := <Chrome_RenderWidgetHostHWND> controltype:= <UIA_DocumentControlTypeId> ,<50030> , (0000C36E) rect := < 0;71;1920;969> hwnd := < 7013936> acceleratorkey := < > automationid := <9968640> <propertymatching></propertymatching>Storing parent for found object in RTI as RTI.PARENT - XXXX - Google Chrome <action>Action 1 object on controltype:=Document _UIA_IsElement:=1 Parameters 1:=0 2:=0 3:=0 4:=0</action></logline>

<logline timestamp="20230301-102836813" level="0"> </logline>

<logline timestamp="20230301-102836813" level="0"> Quickly referenced object : <action>Action 2 setfocus on _UIA_IsElement:=1 Parameters 1:=0 2:=0 3:=0 4:=0</action></logline>

<logline timestamp="20230301-102838077" level="5"> Matching controltype transformed to propertynumber: 30003: for having value 50030</logline>

<logline timestamp="20230301-102838108" level="5"> UIA found the element</logline>

<logline timestamp="20230301-102838244" level="5"> _UIA_normalizeExpression title:=XXXX;elements 1-1 in properties array</logline>

<logline timestamp="20230301-102838244" level="5"> _UIA_normalizeExpression property 1 title:=XXXX</logline>

<logline timestamp="20230301-102838244" level="5"> name:[XXXX] value:[XXXX] having index 3</logline>

<logline timestamp="20230301-102838244" level="5"> *** Try to get a list of elements *** treescopetype:=7</logline>

<logline timestamp="20230301-102838396" level="0"> _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 189</logline>


-<logline timestamp="20230301-102839231" level="5">

<propertymatching/>

</logline>

</log>

Would appreciate some help !!!!!!!!

Link to comment
Share on other sites

15 hours ago, junkew said:

Use inspect.exe to see if it really differs. And the actual tree can be different on different windows versions. It can also differ due to admin user or not. It can differ between 32 and 64 bit applications. It can differ due to ......

Hello will give all of that a try. Im not sure if your answer cut off also, I can see "..." at the end. Or I see what you are seeing the tree differs massively based on a LOT of different factors. But surely this is because of some different version of the accessibility library running on the os environment. I might try to run a debugger and see what is being loaded when. 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...