Sign in to follow this  
Followers 0
testing1

Any parameters instead of instance and position that could be used?

12 posts in this topic

Hi,

Does anyone have an idea if we could use  some parameters other than the Instance and position while using ControlClick Commands? Correct me on this: The instance of an object changes everytime you do an action on it?

Also what is the best way to use ControlClick command , i.e in such way that the parameters we pass in the command do not change in the app under test.

Share this post


Link to post
Share on other sites



There is no "best way"... It all depends on the window you're trying to automate.

You can use the Advanded Mode (ex: [CLASS:SysListView32; INSTANCE:1]) => Help file : Using AutoIt / Controls

Is it for an AutoIt GUI or an external window ?

Share this post


Link to post
Share on other sites

Hi,

I am using advanced mode "[CLASS:SysListView32; INSTANCE:1" but looks like this instance changes, am usind a windows app which is built using VC++, is there a way where i could use a parameter that would not change?

Share this post


Link to post
Share on other sites

Here's the summary:

>>>> Window <<<<
Title:    windowtitle
Class:    Afx:400000:b:10011:6:85606a7
Position:    317, 103
Size:    648, 514
Style:    0x14CE0000
ExStyle:    0x00000100
Handle:    0x001D0364

>>>> Control <<<<
Class:    AfxOleControl42
Instance:    1142
ClassnameNN:    AfxOleControl421142
Name:    
Advanced (Class):    [CLASS:AfxOleControl42; INSTANCE:1142]
ID:    
Text:   Tilt
Position:    2, 2
Size:    56, 31
ControlClick Coords:    24, 16
Style:    0x56000000
ExStyle:    0x00000004
Handle:    0x000604DA

>>>> Mouse <<<<
Position:    26, 18
Cursor ID:    0
Color:    0xC0C0C0

 

The instance keeps changing for each new action, so advanced mode is of not much help. not understanding which parameters should i fetch so as to get ControlClick working. all help appreciated.
 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Are there any other AfxOleControl42 controls in this Window ?

What about using just the class ?  "[CLASS:AfxOleControl42]"

 

Are you sure that the size and position change everytime ?

You can try with "[X:2; Y:2]" or "[W:56; H:31]"

Edited by jguinch

Share this post


Link to post
Share on other sites

do you mean

ControlClick ("title","text", "[X:2, Y:2] OR "[W:56, H:31]")

Just tried but no luck :(

Share this post


Link to post
Share on other sites

All the controls use Class:AfxOleControl42, so unable to use the class too, size doesnt change but the instance does.

Share this post


Link to post
Share on other sites

 yes tried ControlClick ("title","text", "[W:56, H:31]" and ControlClick ("title","text", "[X:2, Y:2]" I  cant see anything being clicked when i run it. am i missing something basic? or the parameters of our app arent supported?

Share this post


Link to post
Share on other sites

Not sure if this method will work..., replace windowtitle in the first line with your window title:

Local $GetWinHandle = WinList("[CLASS:Afx:400000:b:10011:6:85606a7]", "windowtitle")
Local $hWin = $GetWinHandle[1][1]
Local $hWinCtrl = ControlGetHandle($HTilt, "Tilt")
WinActivate($GetWinHandle)
ControlFocus($hWinCtrl, "Tilt")
ControlClick($hWinCtrl, "Tilt")

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