maniootek Posted September 15, 2014 Share Posted September 15, 2014 Hi guys. Please take a look on this movie. I have control which is recognized as "AutoIt Window Info" control when it's not. It's other program control. Any idea how to send a key to that control? How to get "access" to this control (get handle or something) sorry that movie is so long! I hope someone can spend that few minutes to try to help me ! thank you in advance! Link to comment Share on other sites More sharing options...
Bert Posted September 15, 2014 Share Posted September 15, 2014 look here: '?do=embed' frameborder='0' data-embedContent>> The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
maniootek Posted September 17, 2014 Author Share Posted September 17, 2014 (edited) Thank you! I did some tests and this is what I go so far: local $hWindow = WinGetHandle("Subiekt") local $hHyper = ControlGetHandle($hWindow, "", "[CLASSNN:ins_combohyperlink1]") ControlClick($hWindow, "", $hHyper);works ControlSend($hWindow, "", "[CLASSNN:ListBox1]", "{UP}") ; <doesn't work ;I think this Control called "ListBox1" is not recognized as Subiekt's control #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_Action("title:=MAG - Główny;ControlType:=UIA_ListItemControlTypeId","click") and this works! BUT, when I change this line: _UIA_Action("title:=MAG - Główny;ControlType:=UIA_ListItemControlTypeId","invoke") then it only marks on red my control and it does not "click" on it any idea? Edited September 17, 2014 by maniootek Link to comment Share on other sites More sharing options...
junkew Posted September 17, 2014 Share Posted September 17, 2014 yes, I understand more or less why. Not all controls support invoke although sometimes they say they do. In that scenario its better to use click as that first moves mouse to right location and then sends a mouseclick on that location. invoke for some controls just invokes without mousemovement but unpredictable which ones support this. inspect.exe within windows 7 SDK tools can help you a little better on looking if invoke works although even that does not quarantee it works. simplespy can tell you if invoke pattern is supported but as said no quarantee and click is on a safer side. 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...
maniootek Posted September 19, 2014 Author Share Posted September 19, 2014 (edited) Thanks junkew! May I also know why each time I run my script then some xml file with log or something is created under the script location? I just want to add that my script contains that lines: ;~ Some settings to use as a default _UIA_setVar("Global.Debug", False) _UIA_setVar("Global.Debug.File", False) _UIA_setVar("Global.Highlight", False) Edited September 19, 2014 by maniootek Link to comment Share on other sites More sharing options...
junkew Posted September 19, 2014 Share Posted September 19, 2014 If you turn them on false you should not get an xml file will check if I implemented that properly The reason is that if you have more scripts in a testing framework you have to see pass/fail/warning and framework messages intention is later on that you can choose which levels to write to log depending on the configuration 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...
maniootek Posted September 19, 2014 Author Share Posted September 19, 2014 Just an example. After script is finished an xml file was created under name: 20140919-154954747.xml which contains: <?xml version="1.0" encoding="UTF-8"?><log space="preserve"><logline level="5" timestamp="20140919-154954748"> <information> Information_UIA_VersionInfoversion T0.5-0Release date: 20140912</information></logline> </log> 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