Sign in to follow this  
Followers 0
maniootek

How to send a key to control which is not recognized

7 posts in this topic

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!

Share this post


Link to post
Share on other sites



#3 ·  Posted (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 by maniootek

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by maniootek

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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>
 

 

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0