
rvicta
Members-
Posts
4 -
Joined
-
Last visited
Everything posted by rvicta
-
IUIAutomation MS framework automate chrome, FF, IE, ....
rvicta replied to junkew's topic in AutoIt Example Scripts
Thank you for the help, junkew. Using $UIA_LegacyIAccessibleValuePropertyId for edit controls I am able to determine if it is empty. Using Inspect.exe I was able to see that ValuePropertId would either contain the value or an empty string. -
IUIAutomation MS framework automate chrome, FF, IE, ....
rvicta replied to junkew's topic in AutoIt Example Scripts
Thank you, junkew, for your suggestions. This worked great for what I was trying to do. I can now read the text controls properly. But now, I have come upon an odd behavior. This is still the same Chrome session for a customer. I have 3 (actually there are more and they exhibit this same behavior but I'm using these three as an example) edit controls on the screen. The first and third controls have different values in them. When I write their values to the console they showed the correct values. The second edit control, if it is empty on the screen, will show me the same value as the first edit control when I write it to the console. I know the index is correct for this edit control because I commented out the code to read from all other edit controls on the page and the correct one gets highlighted when running the script. Local $oPhasedOut = _UIA_getObjectByFindAll($oDocument, "controltype:=" & $UIA_TextControlTypeId & ";Index:=15", $treescope_subtree) Local $sPhasedOut = _UIA_action($oPhasedOut, "property", "title") ConsoleWrite("Phased Out: " & $sPhasedOut & @CRLF) Local $oCost = _UIA_getObjectByFindAll($oDocument, "controltype:=" & $UIA_EditControlTypeId & ";Index:=6", $treescope_subtree) Local $sCost = _UIA_Action($oCost, "getValue") ConsoleWrite("Cost: " & $sCost & @CRLF) Local $oTrade = _UIA_getObjectByFindAll($oDocument, "controltype:=" & $UIA_EditControlTypeId & ";Index:=7", $treescope_subtree) Local $sTrade = _UIA_Action($oTrade, "getValue") ConsoleWrite("Trade: " & $sTrade & @CRLF) Local $oList = _UIA_getObjectByFindAll($oDocument, "controltype:=" & $UIA_EditControlTypeId & ";Index:=8", $treescope_subtree) Local $sList = _UIA_Action($oList, "getValue") ConsoleWrite("List: " & $sList & @CRLF) The output from SimplySpy for this empty edit control is: Having the following values for all properties: Title is: <> Class := <> controltype:= <UIA_EditControlTypeId> ,<50004> , (0000C354) 610;551;87;20 *** Parent Information top down *** 5: Title is: <BS1-My Favorites> Class := <Chrome_WidgetWin_1> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370) 14;16;1663;1056 "Title:=BS1-My Favorites;controltype:=UIA_WindowControlTypeId;class:=Chrome_WidgetWin_1"" 4: Title is: <BS1-My Favorites> Class := <Chrome_RenderWidgetHostHWND> controltype:= <UIA_DocumentControlTypeId> ,<50030> , (0000C36E) 22;101;1647;963 "Title:=BS1-My Favorites;controltype:=UIA_DocumentControlTypeId;class:=Chrome_RenderWidgetHostHWND"" 3: Title is: <> Class := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 22;101;1647;808 "Title:=;controltype:=UIA_CustomControlTypeId;class:="" 2: Title is: <> Class := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 22;136;1647;773 "Title:=;controltype:=UIA_CustomControlTypeId;class:="" 1: Title is: <> Class := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 365;259;961;688 "Title:=;controltype:=UIA_CustomControlTypeId;class:="" 0: Title is: <Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* > Class := <> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 375;285;1023;616 "Title:=Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* ;controltype:=UIA_CustomControlTypeId;class:="" ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=BS1-My Favorites;controltype:=UIA_WindowControlTypeId;class:=Chrome_WidgetWin_1") ;BS1-My Favorites _UIA_setVar("oP2","Title:=BS1-My Favorites;controltype:=UIA_DocumentControlTypeId;class:=Chrome_RenderWidgetHostHWND") ;BS1-My Favorites _UIA_setVar("oP3","Title:=;controltype:=UIA_CustomControlTypeId;class:=") ; _UIA_setVar("oP4","Title:=;controltype:=UIA_CustomControlTypeId;class:=") ; _UIA_setVar("oP5","Title:=;controltype:=UIA_CustomControlTypeId;class:=") ; _UIA_setVar("oP6","Title:=Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* ;controltype:=UIA_CustomControlTypeId;class:=") ;Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* ;~ $oUIElement=_UIA_getObjectByFindAll(".mainwindow", "title:=;ControlType:=UIA_EditControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=;controltype:=UIA_EditControlTypeId;class:=") ;ControlType:=UIA_EditControlTypeId;classname:=") ;~ 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("oUIElement","highlight") ;~_UIA_action("oUIElement","click") ;~ *** Standard code Flexible*** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP5=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=BS1-My Favorites;controltype:=UIA_WindowControlTypeId;class:=Chrome_WidgetWin_1", $treescope_children) _UIA_Action($oP5,"setfocus") Local $oP4=_UIA_getObjectByFindAll($oP5, "Title:=BS1-My Favorites;controltype:=UIA_DocumentControlTypeId;class:=Chrome_RenderWidgetHostHWND", $treescope_children) _UIA_Action($oP4,"setfocus") Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children) Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children) Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children) Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* ;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children) ;~ First find the object in the parent before you can do something ;~$oUIElement=_UIA_getObjectByFindAll(".mainwindow", "title:=;ControlType:=UIA_EditControlTypeId", $treescope_subtree) Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=;ControlType:=UIA_EditControlTypeId", $treescope_subtree) ;~_UIA_action($oUIElement,"highlight") _UIA_action($oUIElement,"click") *** Detailed properties of the highlighted element *** UIA_iaccessiblechildId:= <0> UIA_handle:= <0> UIA_BoundingRectangle:= <610;551;87;20> UIA_ProcessId:= <2964> UIA_ControlType:= <50004> UIA_LocalizedControlType:= <edit> UIA_HasKeyboardFocus:= <False> UIA_IsKeyboardFocusable:= <True> UIA_IsEnabled:= <True> UIA_Culture:= <0> UIA_IsControlElement:= <True> UIA_IsContentElement:= <True> UIA_IsPassword:= <False> UIA_NativeWindowHandle:= <0> UIA_IsOffscreen:= <False> UIA_Orientation:= <0> UIA_IsRequiredForForm:= <False> UIA_IsDockPatternAvailable:= <False> UIA_IsExpandCollapsePatternAvailable:= <False> UIA_IsGridItemPatternAvailable:= <False> UIA_IsGridPatternAvailable:= <False> UIA_IsInvokePatternAvailable:= <True> UIA_IsMultipleViewPatternAvailable:= <False> UIA_IsRangeValuePatternAvailable:= <False> UIA_IsScrollPatternAvailable:= <False> UIA_IsScrollItemPatternAvailable:= <False> UIA_IsSelectionItemPatternAvailable:= <False> UIA_IsSelectionPatternAvailable:= <False> UIA_IsTablePatternAvailable:= <False> UIA_IsTableItemPatternAvailable:= <False> UIA_IsTextPatternAvailable:= <True> UIA_IsTogglePatternAvailable:= <False> UIA_IsTransformPatternAvailable:= <False> UIA_IsValuePatternAvailable:= <True> UIA_IsWindowPatternAvailable:= <False> UIA_ValueIsReadOnly:= <False> UIA_RangeValueValue:= <0> UIA_RangeValueIsReadOnly:= <True> UIA_RangeValueMinimum:= <0> UIA_RangeValueMaximum:= <0> UIA_RangeValueLargeChange:= <0> UIA_RangeValueSmallChange:= <0> UIA_ScrollHorizontalScrollPercent:= <0> UIA_ScrollHorizontalViewSize:= <100> UIA_ScrollVerticalScrollPercent:= <0> UIA_ScrollVerticalViewSize:= <100> UIA_ScrollHorizontallyScrollable:= <False> UIA_ScrollVerticallyScrollable:= <False> UIA_SelectionCanSelectMultiple:= <False> UIA_SelectionIsSelectionRequired:= <False> UIA_GridRowCount:= <0> UIA_GridColumnCount:= <0> UIA_GridItemRow:= <0> UIA_GridItemColumn:= <0> UIA_GridItemRowSpan:= <1> UIA_GridItemColumnSpan:= <1> UIA_DockDockPosition:= <5> UIA_ExpandCollapseExpandCollapseState:= <3> UIA_MultipleViewCurrentView:= <0> UIA_WindowCanMaximize:= <False> UIA_WindowCanMinimize:= <False> UIA_WindowWindowVisualState:= <0> UIA_WindowWindowInteractionState:= <0> UIA_WindowIsModal:= <False> UIA_WindowIsTopmost:= <False> UIA_SelectionItemIsSelected:= <False> UIA_TableRowOrColumnMajor:= <2> UIA_ToggleToggleState:= <2> UIA_TransformCanMove:= <False> UIA_TransformCanResize:= <False> UIA_TransformCanRotate:= <False> UIA_IsLegacyIAccessiblePatternAvailable:= <True> UIA_LegacyIAccessibleChildId:= <0> UIA_LegacyIAccessibleRole:= <42> UIA_LegacyIAccessibleState:= <1048576> UIA_LegacyIAccessibleDefaultAction:= <activate> UIA_IsDataValidForForm:= <False> UIA_ProviderDescription:= <[pid:2964,providerId:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]> UIA_IsItemContainerPatternAvailable:= <False> UIA_IsVirtualizedItemPatternAvailable:= <False> UIA_IsSynchronizedInputPatternAvailable:= <False> I noticed that UIA_iaccessiblevalue is not present for empty edit controls. Is there a way to check for this? Then I would probably know that there is no value. -
IUIAutomation MS framework automate chrome, FF, IE, ....
rvicta replied to junkew's topic in AutoIt Example Scripts
Okay, here's what SimpleSpy gives me. In my script, I can read the contents of an edit control fine, it's the text control that I'm having an issue with. In SimpleSpy it shows that I should be able to get the value. https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/?do=findComment&comment=1156373 At least we have an element title: [Part Number Entry] class: [] Having the following values for all properties: Title is:= <Part Number Entry> Class:= <> Control Type:= <UIA_TextControlTypeId> ID:= <50020> Hex ID (0000C364) Position & Size:= 468;300;197;24 *** Parent Information top down *** 6: Title is: <BS1-My Favorites> Class:= <Chrome_WidgetWin_1> Control Type:= <UIA_WindowControlTypeId> ID:= <50032> Hex ID (0000C370) Position & Size:= 21;20;1663;1056 "Title:=BS1-My Favorites; controltype:=UIA_WindowControlTypeId; class:=Chrome_WidgetWin_1"" 5: Title is: <BS1-My Favorites> Class:= <Chrome_RenderWidgetHostHWND> Control Type:= <UIA_DocumentControlTypeId> ID:= <50030> Hex ID (0000C36E) Position & Size:= 29;105;1647;963 "Title:=BS1-My Favorites; controltype:=UIA_DocumentControlTypeId; class:=Chrome_RenderWidgetHostHWND"" 4: Title is: <> Class:= <> Control Type:= <UIA_CustomControlTypeId> ID:= <50025> Hex ID (0000C369) Position & Size:= 29;105;1647;808 "Title:=; controltype:=UIA_CustomControlTypeId; class:="" 3: Title is: <> Class:= <> Control Type:= <UIA_CustomControlTypeId> ID:= <50025> Hex ID (0000C369) Position & Size:= 29;140;1647;773 "Title:=; controltype:=UIA_CustomControlTypeId; class:="" 2: Title is: <> Class:= <> Control Type:= <UIA_CustomControlTypeId> ID:= <50025> Hex ID (0000C369) Position & Size:= 372;263;961;688 "Title:=; controltype:=UIA_CustomControlTypeId; class:="" 1: Title is: <Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* > Class:= <> Control Type:= <UIA_CustomControlTypeId> ID:= <50025> Hex ID (0000C369) Position & Size:= 382;289;1023;616 "Title:=Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* ; controltype:=UIA_CustomControlTypeId; class:="" 0: Title is: <> Class:= <> Control Type:= <UIA_CustomControlTypeId> ID:= <50025> Hex ID (0000C369) Position & Size:= 467;299;199;26 "Title:=; controltype:=UIA_CustomControlTypeId; class:="" ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=BS1-My Favorites; controltype:=UIA_WindowControlTypeId; class:=Chrome_WidgetWin_1") ;BS1-My Favorites _UIA_setVar("oP2","Title:=BS1-My Favorites; controltype:=UIA_DocumentControlTypeId; class:=Chrome_RenderWidgetHostHWND") ;BS1-My Favorites _UIA_setVar("oP3","Title:=; controltype:=UIA_CustomControlTypeId; class:=") ; _UIA_setVar("oP4","Title:=; controltype:=UIA_CustomControlTypeId; class:=") ; _UIA_setVar("oP5","Title:=; controltype:=UIA_CustomControlTypeId; class:=") ; _UIA_setVar("oP6","Title:=Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* ; controltype:=UIA_CustomControlTypeId; class:=") ;Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* _UIA_setVar("oP7","Title:=; controltype:=UIA_CustomControlTypeId; class:=") ; ;~ $oUIElement=_UIA_getObjectByFindAll("Part Number Entry.mainwindow", "title:=Part Number Entry ;ControlType:=UIA_TextControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=Part Number Entry;controltype:=UIA_TextControlTypeId;class:=" ) ;ControlType:=UIA_TextControlTypeId ;classname:=") ;~ 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("oUIElement","highlight") ;~_UIA_action("oUIElement","click") ;~ *** Standard code Flexible*** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP6=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=BS1-My Favorites; controltype:=UIA_WindowControlTypeId; class:=Chrome_WidgetWin_1", $treescope_children) _UIA_Action($oP6,"setfocus") Local $oP5=_UIA_getObjectByFindAll($oP6, "Title:=BS1-My Favorites; controltype:=UIA_DocumentControlTypeId; class:=Chrome_RenderWidgetHostHWND", $treescope_children) _UIA_Action($oP5,"setfocus") Local $oP4=_UIA_getObjectByFindAll($oP5, "Title:=; controltype:=UIA_CustomControlTypeId; class:=", $treescope_children) Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=; controltype:=UIA_CustomControlTypeId; class:=", $treescope_children) Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=; controltype:=UIA_CustomControlTypeId; class:=", $treescope_children) Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=Part Number Entry GM :AD1000 Description GEAR OIL Non-Stocked On Hand 0 Last Sale 10/01/13 In Invent Stock Group* 203 Phased Out 3/07/15 Group Cost Stock Status Trade Order Status List 27.68 Minimum Flat Price Maximum Comp 1 Pack Quantity 1 Comp 2 Low Year Update* Y High Year Prog Code Reman Ind New Return Code Price Guide Promo Code* Taxable* Y Remarks/Dsp Function* Ok Exit Cancel Bin/Shelf* ; controltype:=UIA_CustomControlTypeId; class:=", $treescope_children) Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=; controltype:=UIA_CustomControlTypeId; class:=", $treescope_children) ;~ First find the object in the parent before you can do something ;~$oUIElement=_UIA_getObjectByFindAll("Part Number Entry.mainwindow", "title:=Part Number Entry ;ControlType:=UIA_TextControlTypeId", $treescope_subtree) Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Part Number Entry;ControlType:= UIA_TextControlTypeId", $treescope_subtree) ;~_UIA_action($oUIElement,"highlight") _UIA_action($oUIElement,"click") *** Detailed properties of the highlighted element *** UIA_title:= <Part Number Entry> UIA_text:= <Part Number Entry> UIA_regexptitle:= <Part Number Entry> UIA_iaccessiblechildId:= <0> UIA_handle:= <0> UIA_BoundingRectangle:= <468;300;197;24> UIA_ProcessId:= <7016> UIA_ControlType:= <50020> UIA_LocalizedControlType:= <text> UIA_Name:= <Part Number Entry> UIA_HasKeyboardFocus:= <False> UIA_IsKeyboardFocusable:= <False> UIA_IsEnabled:= <True> UIA_Culture:= <0> UIA_IsControlElement:= <True> UIA_IsContentElement:= <True> UIA_IsPassword:= <False> UIA_NativeWindowHandle:= <0> UIA_IsOffscreen:= <False> UIA_Orientation:= <0> UIA_IsRequiredForForm:= <False> UIA_IsDockPatternAvailable:= <False> UIA_IsExpandCollapsePatternAvailable:= <False> UIA_IsGridItemPatternAvailable:= <False> UIA_IsGridPatternAvailable:= <False> UIA_IsInvokePatternAvailable:= <True> UIA_IsMultipleViewPatternAvailable:= <False> UIA_IsRangeValuePatternAvailable:= <False> UIA_IsScrollPatternAvailable:= <False> UIA_IsScrollItemPatternAvailable:= <False> UIA_IsSelectionItemPatternAvailable:= <False> UIA_IsSelectionPatternAvailable:= <False> UIA_IsTablePatternAvailable:= <False> UIA_IsTableItemPatternAvailable:= <False> UIA_IsTextPatternAvailable:= <False> UIA_IsTogglePatternAvailable:= <False> UIA_IsTransformPatternAvailable:= <False> UIA_IsValuePatternAvailable:= <False> UIA_IsWindowPatternAvailable:= <False> UIA_ValueIsReadOnly:= <True> UIA_RangeValueValue:= <0> UIA_RangeValueIsReadOnly:= <True> UIA_RangeValueMinimum:= <0> UIA_RangeValueMaximum:= <0> UIA_RangeValueLargeChange:= <0> UIA_RangeValueSmallChange:= <0> UIA_ScrollHorizontalScrollPercent:= <0> UIA_ScrollHorizontalViewSize:= <100> UIA_ScrollVerticalScrollPercent:= <0> UIA_ScrollVerticalViewSize:= <100> UIA_ScrollHorizontallyScrollable:= <False> UIA_ScrollVerticallyScrollable:= <False> UIA_SelectionCanSelectMultiple:= <False> UIA_SelectionIsSelectionRequired:= <False> UIA_GridRowCount:= <0> UIA_GridColumnCount:= <0> UIA_GridItemRow:= <0> UIA_GridItemColumn:= <0> UIA_GridItemRowSpan:= <1> UIA_GridItemColumnSpan:= <1> UIA_DockDockPosition:= <5> UIA_ExpandCollapseExpandCollapseState:= <3> UIA_MultipleViewCurrentView:= <0> UIA_WindowCanMaximize:= <False> UIA_WindowCanMinimize:= <False> UIA_WindowWindowVisualState:= <0> UIA_WindowWindowInteractionState:= <0> UIA_WindowIsModal:= <False> UIA_WindowIsTopmost:= <False> UIA_SelectionItemIsSelected:= <False> UIA_TableRowOrColumnMajor:= <2> UIA_ToggleToggleState:= <2> UIA_TransformCanMove:= <False> UIA_TransformCanResize:= <False> UIA_TransformCanRotate:= <False> UIA_IsLegacyIAccessiblePatternAvailable:= <True> UIA_LegacyIAccessibleChildId:= <0> UIA_LegacyIAccessibleName:= <Part Number Entry> UIA_LegacyIAccessibleRole:= <41> UIA_LegacyIAccessibleState:= <0> UIA_LegacyIAccessibleDefaultAction:= <click ancestor> UIA_IsDataValidForForm:= <False> UIA_ProviderDescription:= <[pid:7016,providerId:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]> UIA_IsItemContainerPatternAvailable:= <False> UIA_IsVirtualizedItemPatternAvailable:= <False> UIA_IsSynchronizedInputPatternAvailable:= <False> -
IUIAutomation MS framework automate chrome, FF, IE, ....
rvicta replied to junkew's topic in AutoIt Example Scripts
Okay, first of all I would like to commend junkew for this great tool. I have run into a little snag that I can't seem to figure out. Below is a snippet of my code. The script works great up until this point of getting me into our customer's data page. The purpose of this piece is to grab data from what is displayed so we can analyze it before making changes and to also save the "before" data before we update in case we ever have to roll back the data. The part that is giving me an issue is the "getValue" in the code that reads from the text control. SimplySpy identified the control properly and shows the information in it correctly. But, when I write the data to the console it will show me something random. For this piece of code, it actually shows me code from the script. Which I don't even understand how it's coming up with that. I can read the contents of the edit controls fine, it's just the text controls that are giving me a problem. I need to be able to read them to make sure I'm on the right product before attempting to make any changes. Any help and/or suggestions from anyone would be greatly appreciated as I can't seem to get past this issue. $oChrome = _UIA_getFirstObjectOfElement($UIA_oDesktop, "class:=Chrome_WidgetWin_1", $treescope_children) $oDocument = _UIA_getFirstObjectOfElement($oChrome, "controltype:=" & $UIA_DocumentControlTypeId, $treescope_subtree) Local $oRVTest = _UIA_getObjectByFindAll($oDocument, "controltype:=" & $UIA_TextControlTypeId & ";Index:=2", $treescope_subtree) Local $sRVTest = _UIA_Action($oRVTest, "getValue") ConsoleWrite($sRVTest & @CRLF) ; $oPartID = _UIA_getObjectByFindAll($oDocument, "controltype:=" & $UIA_TextControlTypeId & ";Index:=3", $treescope_subtree) ; $sPartID = _UIA_Action("$oPartID", "getValue") ; ConsoleWrite($sPartID & @CRLF) Local $oDescription = _UIA_getObjectByFindAll($oDocument, "controltype:=" & $UIA_EditControlTypeId & ";Index:=1", $treescope_subtree) Local $sDescription = _UIA_Action($oDescription, "getValue") ConsoleWrite($sDescription & @CRLF) Local $oBin = _UIA_getObjectByFindAll($oDocument, "controltype:=" & $UIA_EditControlTypeId & ";Index:=2", $treescope_subtree) Local $sBin = _UIA_Action($oBin, "getValue") ConsoleWrite($sBin & @CRLF)