Jump to content

IUIAutomation and actual Google Chrome version


Go to solution Solved by FLASHCODER1,

Recommended Posts

Hi my friends,

I've been testing the example (ex5_chrome.au3) that I found in this link => '?do=embed' frameborder='0' data-embedContent>> in attachment into EXAMPLES_v0_5.zip and with includes files of UIA_V0_4.zip, before of compile I get an error message that comes from UIAWrappers.au3 file saying like: Variable must be of type "Object", see link below:

http://prntscr.com/540n4i
 
Then, someone could help me solve this problem?
 
Any suggestion will welcome!
 
Thanks in advance.
Edited by FLASHCODER1
Link to comment
Share on other sites

Which version of autoit? What do you want to accomplish. What is simplespy doing?

 

Hi Junkew, thank you very much for attention to my question. I'm using:

Windows 7 Ultimate x64

Google Chrome v38.0.2125.111

SciTE Version 3.3.0

Autoit V3.3.8.1

and I want retrieve also the value of address bar. I saw in txt log file and I can get others values, like title of active window and others, but not comes value the address bar:

;~  get the value of the addressbar
$myText=""
$oValueP.CurrentValue($myText)
consolewrite("address: " & $myText & @CRLF)
;~ Exit
Edited by FLASHCODER1
Link to comment
Share on other sites

make sure no chrome.exe is in your processes. Chrome keeps them around even when you exit chrome (check your advanced settings that no process should be left in background after closing)

Most likely it goes already wrong in main script at this line as no chrome is shown

$oChrome=_UIA_getFirstObjectOfElement($UIA_oDesktop,"class:=Chrome_WidgetWin_1", $treescope_children)
Link to comment
Share on other sites

Please try simplespy.au3 to run first to see if the basics are properly working

 

 

make sure no chrome.exe is in your processes. Chrome keeps them around even when you exit chrome (check your advanced settings that no process should be left in background after closing)

Most likely it goes already wrong in main script at this line as no chrome is shown

$oChrome=_UIA_getFirstObjectOfElement($UIA_oDesktop,"class:=Chrome_WidgetWin_1", $treescope_children)

 

Say me,

the example (ex5_chrome.au3) works fine in your computer?

simplespy.au3, don't have any error in sintaxe, but not retrieves the value of address bar, retrieves only name and type of control: Address and search bar and UIA_EditControlTypeId, respectively.

Edited by FLASHCODER1
Link to comment
Share on other sites

yes on my system it works

and my simplespy gives the information in UIA_iaccessiblevalue property

*** Detailed properties of the highlighted element ***
UIA_title:= <Adres- en zoekbalk>
UIA_text:= <Adres- en zoekbalk>
UIA_regexptitle:= <Adres- en zoekbalk>
UIA_iaccessiblevalue:= <www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/>
UIA_iaccessiblechildId:= <0>

tested against autoit version 3.3.9.17-beta

full output of example 5 (3 tabs are open and 1 is new tab)

>"\autoit\autoit-v3\install\SciTe\..\autoit3.exe" /ErrorStdOut "\autoit\automation\ex5_chrome.au3"
address: www.autoitscript.com/forum/topic/165547-iuiautomation-and-actual-google-chrome-version/
Title is: <Nieuw tabblad>   Class   := <>   controltype:= <50000>   
Title is: <IUIAutomation and actual Google Chrome version - General Help and Support - AutoIt Forums>   Class   := <>   controltype:= <50019>   
Title is: <IUIAutomation MS framework automate chrome, FF, IE, .... - Example Scripts - AutoIt Forums>  Class   := <>   controltype:= <50019>   
>Exit code: 0    Time: 4.422
Edited by junkew
Link to comment
Share on other sites

Please search a little better on mainpage for beta installer. But anyway first check what simplespy tells you and post that over here.

 

@Junkew,

Here is result from simplespy.au3 in Google Chrome after pressed CTRL+W with address bar url in focus (with mouse cursor):
Mouse position is retrieved 794-42
At least we have an element [Barra de endereço e de pesquisa][]
Having the following values for all properties: 
Title is: <Barra de endereço e de pesquisa> Class   := <> controltype:= <UIA_EditControlTypeId> ,<50004> , (0000C354)
*** Parent Information ***
Title is: <> Class   := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369)
*** Detailed properties of the highlighted element ***
UIA_AcceleratorKeyPropertyId :=
UIA_AccessKeyPropertyId :=
UIA_AriaPropertiesPropertyId :=
UIA_AriaRolePropertyId :=
UIA_AutomationIdPropertyId :=
UIA_BoundingRectanglePropertyId :=120;30;1166;25
UIA_ClassNamePropertyId :=
UIA_ClickablePointPropertyId :=
UIA_ControllerForPropertyId :=
UIA_ControlTypePropertyId :=50004
UIA_CulturePropertyId :=0
UIA_DescribedByPropertyId :=
UIA_DockDockPositionPropertyId :=5
UIA_ExpandCollapseExpandCollapseStatePropertyId :=3
UIA_FlowsToPropertyId :=
UIA_FrameworkIdPropertyId :=
UIA_GridColumnCountPropertyId :=0
UIA_GridItemColumnPropertyId :=0
UIA_GridItemColumnSpanPropertyId :=1
UIA_GridItemContainingGridPropertyId :=
UIA_GridItemRowPropertyId :=0
UIA_GridItemRowSpanPropertyId :=1
UIA_GridRowCountPropertyId :=0
UIA_HasKeyboardFocusPropertyId :=True
UIA_HelpTextPropertyId :=OmniboxViewViews
UIA_IsContentElementPropertyId :=True
UIA_IsControlElementPropertyId :=True
UIA_IsDataValidForFormPropertyId :=False
UIA_IsDockPatternAvailablePropertyId :=False
UIA_IsEnabledPropertyId :=True
UIA_IsExpandCollapsePatternAvailablePropertyId :=False
UIA_IsGridItemPatternAvailablePropertyId :=False
UIA_IsGridPatternAvailablePropertyId :=False
UIA_IsInvokePatternAvailablePropertyId :=False
UIA_IsItemContainerPatternAvailablePropertyId :=False
UIA_IsKeyboardFocusablePropertyId :=True
UIA_IsLegacyIAccessiblePatternAvailablePropertyId :=True
UIA_IsMultipleViewPatternAvailablePropertyId :=False
UIA_IsOffscreenPropertyId :=False
UIA_IsPasswordPropertyId :=False
UIA_IsRangeValuePatternAvailablePropertyId :=False
UIA_IsRequiredForFormPropertyId :=False
UIA_IsScrollItemPatternAvailablePropertyId :=False
UIA_IsScrollPatternAvailablePropertyId :=False
UIA_IsSelectionItemPatternAvailablePropertyId :=False
UIA_IsSelectionPatternAvailablePropertyId :=False
UIA_IsSynchronizedInputPatternAvailablePropertyId :=False
UIA_IsTableItemPatternAvailablePropertyId :=False
UIA_IsTablePatternAvailablePropertyId :=False
UIA_IsTextPatternAvailablePropertyId :=False
UIA_IsTogglePatternAvailablePropertyId :=False
UIA_IsTransformPatternAvailablePropertyId :=False
UIA_IsValuePatternAvailablePropertyId :=True
UIA_IsVirtualizedItemPatternAvailablePropertyId :=False
UIA_IsWindowPatternAvailablePropertyId :=False
UIA_ItemStatusPropertyId :=
UIA_ItemTypePropertyId :=
UIA_LabeledByPropertyId :=
UIA_LegacyIAccessibleChildIdPropertyId :=0
UIA_LegacyIAccessibleDefaultActionPropertyId :=
UIA_LegacyIAccessibleDescriptionPropertyId :=
UIA_LegacyIAccessibleHelpPropertyId :=OmniboxViewViews
UIA_LegacyIAccessibleKeyboardShortcutPropertyId :=
UIA_LegacyIAccessibleNamePropertyId :=Barra de endereço e de pesquisa
UIA_LegacyIAccessibleRolePropertyId :=42
UIA_LegacyIAccessibleSelectionPropertyId :=
UIA_LegacyIAccessibleStatePropertyId :=1048580
UIA_LegacyIAccessibleValuePropertyId :=www.autoitscript.com/forum/topic/165547-iuiautomation-and-actual-google-chrome-version/
UIA_LocalizedControlTypePropertyId :=editar
UIA_MultipleViewCurrentViewPropertyId :=0
UIA_MultipleViewSupportedViewsPropertyId :=
UIA_NamePropertyId :=Barra de endereço e de pesquisa
UIA_NativeWindowHandlePropertyId :=0
UIA_OrientationPropertyId :=0
UIA_ProcessIdPropertyId :=2772
UIA_ProviderDescriptionPropertyId :=[pid:2772,hwnd:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]
UIA_RangeValueIsReadOnlyPropertyId :=True
UIA_RangeValueLargeChangePropertyId :=0
UIA_RangeValueMaximumPropertyId :=0
UIA_RangeValueMinimumPropertyId :=0
UIA_RangeValueSmallChangePropertyId :=0
UIA_RangeValueValuePropertyId :=0
UIA_RuntimeIdPropertyId :=
UIA_ScrollHorizontallyScrollablePropertyId :=False
UIA_ScrollHorizontalScrollPercentPropertyId :=0
UIA_ScrollHorizontalViewSizePropertyId :=100
UIA_ScrollVerticallyScrollablePropertyId :=False
UIA_ScrollVerticalScrollPercentPropertyId :=0
UIA_ScrollVerticalViewSizePropertyId :=100
UIA_SelectionCanSelectMultiplePropertyId :=False
UIA_SelectionIsSelectionRequiredPropertyId :=False
UIA_SelectionselectionPropertyId :=
UIA_SelectionItemIsSelectedPropertyId :=False
UIA_SelectionItemSelectionContainerPropertyId :=
UIA_TableColumnHeadersPropertyId :=
UIA_TableItemColumnHeaderItemsPropertyId :=
UIA_TableRowHeadersPropertyId :=
UIA_TableRowOrColumnMajorPropertyId :=2
UIA_TableItemRowHeaderItemsPropertyId :=
UIA_ToggleToggleStatePropertyId :=2
UIA_TransformCanMovePropertyId :=False
UIA_TransformCanResizePropertyId :=False
UIA_TransformCanRotatePropertyId :=False
UIA_ValueIsReadOnlyPropertyId :=False
UIA_ValueValuePropertyId :=www.autoitscript.com/forum/topic/165547-iuiautomation-and-actual-google-chrome-version/
UIA_WindowCanMaximizePropertyId :=False
UIA_WindowCanMinimizePropertyId :=False
UIA_WindowIsModalPropertyId :=False
UIA_WindowIsTopmostPropertyId :=False
UIA_WindowWindowInteractionStatePropertyId :=0
UIA_WindowWindowVisualStatePropertyId :=0

 

And here is result with Google Chrome from log file generated from ex5_chrome.au3:

20141116-170838069 matched: class30012
20141116-170838069 Matching: 30012 for Chrome_WidgetWin_1
20141116-170838147 matched: name30005
20141116-170838147 Matching: 30005 for Google Chrome Toolbar
20141116-170838845 ***** Dumping tree *****
20141116-170838970 Title is: <IUIAutomation and actual Google Chrome version - General Help and Support - AutoIt Forums - Google Chrome> Class   := <Chrome_WidgetWin_1> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370) , acceleratorkey:= <> , automationid:= <>
20141116-170838985 Title is: <> Class   := <Chrome_RenderWidgetHostHWND> controltype:= <UIA_DocumentControlTypeId> ,<50030> , (0000C36E) , acceleratorkey:= <> , automationid:= <146034368>
20141116-170838985 Title is: <> Class   := <> controltype:= <UIA_TitleBarControlTypeId> ,<50037> , (0000C375) , acceleratorkey:= <> , automationid:= <>
20141116-170838985 Title is: <Sistema> Class   := <> controltype:= <UIA_MenuBarControlTypeId> ,<50010> , (0000C35A) , acceleratorkey:= <> , automationid:= <>
20141116-170838985 Title is: <Sistema> Class   := <> controltype:= <UIA_MenuItemControlTypeId> ,<50011> , (0000C35B) , acceleratorkey:= <> , automationid:= <>
20141116-170838985 Title is: <Minimizar> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170838985 Title is: <Restaurar> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839001 Title is: <Fechar> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839001 Title is: <Google Chrome> Class   := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) , acceleratorkey:= <> , automationid:= <>
20141116-170839001 Title is: <> Class   := <> controltype:= <UIA_TitleBarControlTypeId> ,<50037> , (0000C375) , acceleratorkey:= <> , automationid:= <>
20141116-170839001 Title is: <Minimizar> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839001 Title is: <Restaurar> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839016 Title is: <Fechar> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839016 Title is: <> Class   := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) , acceleratorkey:= <> , automationid:= <>
20141116-170839016 Title is: <> Class   := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) , acceleratorkey:= <> , automationid:= <>
20141116-170839016 Title is: <> Class   := <> controltype:= <UIA_DocumentControlTypeId> ,<50030> , (0000C36E) , acceleratorkey:= <> , automationid:= <>
20141116-170839032 Title is: <> Class   := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) , acceleratorkey:= <> , automationid:= <>
20141116-170839032 Title is: <> Class   := <> controltype:= <UIA_TabControlTypeId> ,<50018> , (0000C362) , acceleratorkey:= <> , automationid:= <>
20141116-170839032 Title is: <Nova guia> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839032 Title is: <IUIAutomation and actual Google Chrome version - General Help and Support - AutoIt Forums> Class   := <> controltype:= <UIA_TabItemControlTypeId> ,<50019> , (0000C363) , acceleratorkey:= <> , automationid:= <>
20141116-170839048 Title is: <IUIAutomation and actual Google Chrome version - General Help and Support - AutoIt Forums> Class   := <> controltype:= <UIA_TextControlTypeId> ,<50020> , (0000C364) , acceleratorkey:= <> , automationid:= <>
20141116-170839048 Title is: <Fechar> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839048 Title is: <Barra de ferramentas do Google Chrome> Class   := <> controltype:= <UIA_ToolBarControlTypeId> ,<50021> , (0000C365) , acceleratorkey:= <> , automationid:= <>
20141116-170839048 Title is: <Voltar> Class   := <> controltype:= <UIA_SplitButtonControlTypeId> ,<50031> , (0000C36F) , acceleratorkey:= <> , automationid:= <>
20141116-170839063 Title is: <> Class   := <> controltype:= <UIA_ImageControlTypeId> ,<50006> , (0000C356) , acceleratorkey:= <> , automationid:= <>
20141116-170839063 Title is: <> Class   := <> controltype:= <UIA_TextControlTypeId> ,<50020> , (0000C364) , acceleratorkey:= <> , automationid:= <>
20141116-170839063 Title is: <Avançar> Class   := <> controltype:= <UIA_SplitButtonControlTypeId> ,<50031> , (0000C36F) , acceleratorkey:= <> , automationid:= <>
20141116-170839063 Title is: <> Class   := <> controltype:= <UIA_ImageControlTypeId> ,<50006> , (0000C356) , acceleratorkey:= <> , automationid:= <>
20141116-170839079 Title is: <> Class   := <> controltype:= <UIA_TextControlTypeId> ,<50020> , (0000C364) , acceleratorkey:= <> , automationid:= <>
20141116-170839079 Title is: <Recarregar> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839079 Title is: <> Class   := <> controltype:= <UIA_ImageControlTypeId> ,<50006> , (0000C356) , acceleratorkey:= <> , automationid:= <>
20141116-170839094 Title is: <> Class   := <> controltype:= <UIA_TextControlTypeId> ,<50020> , (0000C364) , acceleratorkey:= <> , automationid:= <>
20141116-170839094 Title is: <> Class   := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) , acceleratorkey:= <> , automationid:= <>
20141116-170839094 Title is: <Visualizar informações do site> Class   := <> controltype:= <UIA_ImageControlTypeId> ,<50006> , (0000C356) , acceleratorkey:= <> , automationid:= <>
20141116-170839094 Title is: <Barra de endereço e de pesquisa> Class   := <> controltype:= <UIA_EditControlTypeId> ,<50004> , (0000C354) , acceleratorkey:= <> , automationid:= <>
20141116-170839110 Title is: <Traduzir esta página> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839110 Title is: <Adicionar esta página aos favoritos> Class   := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <>
20141116-170839110 Title is: <Chrome> Class   := <> controltype:= <UIA_MenuItemControlTypeId> ,<50011> , (0000C35B) , acceleratorkey:= <> , automationid:= <>
20141116-170839110 Title is: <> Class   := <> controltype:= <UIA_ImageControlTypeId> ,<50006> , (0000C356) , acceleratorkey:= <> , automationid:= <>
20141116-170839126 Title is: <> Class   := <> controltype:= <UIA_TextControlTypeId> ,<50020> , (0000C364) , acceleratorkey:= <> , automationid:= <>
20141116-170839126 Title is: <> Class   := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) , acceleratorkey:= <> , automationid:= <>
20141116-170839126 matched: controltype30003
20141116-170839126 Matching: 30003 for 50004
 
Result from SciTE Editor console window from ex5_chrome.au3:
 
>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\fhcfhcf\Downloads\ex5_chrome.au3" /UserParams    
+>17:08:37 Starting AutoIt3Wrapper v.2.1.2.9    Environment(Language:0416  Keyboard:00000416  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (1.54.22.0)  from:C:\Program Files (x86)\AutoIt3
+>17:08:37 AU3Check ended.rc:0
>Running:(3.3.8.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\fhcfhcf\Downloads\ex5_chrome.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
C:\Program Files (x86)\AutoIt3\Include\UIAWrappers.au3 (636) : ==> Variable must be of type "Object".:
$t=$obj.Findfirst($TreeScope,$oCondition,$UIA_pUIElement)
$t=$obj^ ERROR
->17:08:39 AutoIt3.exe ended.rc:1
>Exit code: 1    Time: 1.865
 
Edited by FLASHCODER1
Link to comment
Share on other sites

The language of your windows is different (spanish) then english or dutch and as such text/id is not matching and example(s) will not allways work you have to change certain parts and can get this information to hover with simplespy over them pressing ctrl+w and copying relevant parts

it goes wrong already here in your example 5

$oChromeToolbar=_UIA_getFirstObjectOfElement($oChrome,"name:=Google Chrome Toolbar" , $treescope_subtree)

maybe change the name to Barra de endereço e de pesquisa

Looks like you should get simplespy from latest zip or examples and you are not using the latest versions (please download them again)

Latest simple spy should give you working source code directly

Link to comment
Share on other sites

  • Solution

Solved! Thank you very much @Junkew.

The language of your windows is different (spanish) then english or dutch and as such text/id is not matching and example(s) will not allways work you have to change certain parts and can get this information to hover with simplespy over them pressing ctrl+w and copying relevant parts

it goes wrong already here in your example 5

$oChromeToolbar=_UIA_getFirstObjectOfElement($oChrome,"name:=Google Chrome Toolbar" , $treescope_subtree)

maybe change the name to Barra de endereço e de pesquisa

Looks like you should get simplespy from latest zip or examples and you are not using the latest versions (please download them again)

Latest simple spy should give you working source code directly

 

Solved! thank you very much @Junkew.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...