4 posts in this topic
Good Evening Everyone
Long time since I've been in the forums - missing AutoIt and programming dearly - but on with the question... I hope this one is easy
I am using SimpleSpy / UIAWrappers.au3 to automate an application. I basically have a "Stop" button that I am waiting to change from UIA_IsEnabled:= <False> to UIA_IsEnabled:= <True>
How do I check for the UIA_IsEnabled condition ? Of course SimpleSpy gives all the details of GUI elements... but what code do I use to just check the GUI "Stop" buttons UIA_IsEnabled condition?
Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Stop;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree)
Hey there, i have the code from simplespy but have no idea about what to use, got the UIA_V0_64 files.
I look at the examples but i get lost, i ask for guideance in this matter.
To get to this window simply run:
control.exe /name Microsoft.DefaultPrograms /page pageFileAssoc
select a filetype and click "change program"
I'm developing again (everybody ruuun! )
I would like to develope a script that goes through basicly every user control on a window, and log things that happens, and maybe do some screenshots. I did something like this before.
My problem, which I would like to avoid this time (to improve my understanding and skill) , was that when I was unable to get a ControlID or handler or anything, I simply did some math and clicked on the coordinates it should have been (for example, maxing the window, and knowing the initial set up I was ablo to calculate given control position). I know that this is a bad solution for a number of reasons.
Now I got authorization to install autoIT here, and i started to the work, AU3Info was unable to find anything on the window (this could be a problem, since autoIT doesn't see anything on it then, if I understood the help file) So I got the SimpleSpy script (source:
I added a bit of code to the original to display ID as well, what I received is this:
Mouse position is retrieved 115-207
At least we have an element title: [ADD] class: [Button] ID:  (<-- coded this to display ID here as well)
Having the following values for all properties:
Title is: <ADD> Class := <Button> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) 10;187;120;35
*** Parent Information top down ***
3: Title is: <Compass> Class := <Window> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370) -8;-8;1936;1056
2: Title is: <> Class := <MainView> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 0;23;1920;1017
1: Title is: <> Class := <TileNavigationView> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 0;23;1920;967
0: Title is: <> Class := <AreasView> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 0;132;1920;858
so far I wrote this script:
WinActivate('Test') ;It works!! :D first official interaction Sleep(1000) ;1 sec sleep to be sure ControlClick('Test', '', '50000') If @error Then MsgBox($MB_SYSTEMMODAL, 'Error', 'ControlClick error') EndIf Sleep(1000) MsgBox(1,"Tracer message", 'ControlClick has happened') ;MouseClick() ;ControlCommand() AutoIt activates the window, but the click on the given button doesnt happen (I tried to write 50000 without ' ' on ID).
M'I doing the @error part correctly ? (no error Msg has been displayed), sorry I rarely use AutoIT and seems to forget less and less after each neglect, but still I'm far from a proffessional
Any help or suggestion is welcome, thank you for your time and insight!
I am experimenting with UIAWrappers.au3 from junkew to complete an application which presents absolutely no control information using AutoIT Window Info. While I am able to complete the form successfully, I am not happy with the speed. As a benchmark, the simple Send method occurs in far less than 1-second, but the UIAutomation approach takes 3-seconds. I am wondering whether performance gains may be achieved by specifying the controls more precisely; but I am unsure how to do that. I was able to speed things up a bit by setting $UIA_DefaultWaitTime=0. The controls of interest are 5-levels deep, as show in the simplespy output below. It seems I do get faster response by specifying the target/top-level window, as show in the code below. Any ideas?
#include "UIAWrappers.au3" _UIA_setVar("Global.Debug", False) _UIA_setVar("Global.Debug.File", False) _UIA_setVar("Global.Highlight", False) _UIA_setVar("DPN","Title:=NC-stat DPNCheck Communicator;controltype:=UIA_WindowControlTypeId;class:=Window") _UIA_action('DPN','setFocus') _UIA_setVar("DPN.firstName","AutomationId:=txtFirstName") _UIA_setVar("DPN.lastName", "AutomationId:=txtLastName") _UIA_Action('DPN.lastName','setvalue','last name') _UIA_setVar("DPN.ID", "AutomationId:=txtSubjectId") _UIA_setVar("DPN.DOB", "AutomationId:=PART_TextBox") _UIA_setVar("DPN.Ft", "AutomationId:=txtSubjectHeight") _UIA_setVar("DPN.In", "AutomationId:=txtSubjectHeight2") _UIA_Action('DPN.firstName','setvalue','first name') _UIA_Action('DPN.ID','setvalue','ID012345') _UIA_Action('DPN.DOB','setvalue','1/31/1932') _UIA_Action('DPN.Ft','setvalue','6') _UIA_Action('DPN.In','setvalue','1') SimpleSpy output:
;~ *** Standard code *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP4=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=NC-stat DPNCheck Communicator;controltype:=UIA_WindowControlTypeId;class:=Window", $treescope_children) _UIA_Action($oP4,"setfocus") Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Frame", $treescope_children) Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=;controltype:=UIA_TabControlTypeId;class:=TabControl", $treescope_children) Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=Patient;controltype:=UIA_TabItemControlTypeId;class:=TabItem", $treescope_children) Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Frame", $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,"click")
Good Morning All,
I'm using the latest UIA_V0_51 on XP and Windows 7 x64. I'm able to see focus, elements and all options under Windows XP for SimpleSpy - but not on Windows 7 x64. With Windows 7 x64 all I can focus on is the window frame. Very odd. I've tried running simplespy "#AutoIt3Wrapper_UseX64=n" and the app under x32 on the Windows 7 x64 device. Please let me know what I am doing wrong. I believe this is a simple thing I am overlooking... Thank you AutoIT Gurus!!! YOU ARE THE BEST!!!