Jump to content
GSingh

Need help with clicking button on application dialog

Recommended Posts

GSingh

Hi I am new to AutoIT. I am making a script where I can automate clicking of button on dialog.

 

I have tried to use controlclick but no luck. Can someone help please? 

Thanks

Share this post


Link to post
Share on other sites
GSingh
Just now, GSingh said:

I forgot to check on notify me of replies.

 

Share this post


Link to post
Share on other sites
JLogan3o13

Moved to the appropriate forum, as the DEV forum very clearly states:

Quote

Do not create AutoIt-related topics here, use AutoIt General Help and Support

As to your question, "no luck" doesn't tell us anything. How about helping us help you by posting your code ;)

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
GSingh

Run ("setup_REL_SMS_6_3_0.exe")
Sleep(5000)
ControlClick("Screen Management System: Installation Options", "", "[CLASS:BUTTON; TEXT:&Next >; INSTANCE:2]")

 

Share this post


Link to post
Share on other sites
GSingh

>>>> Window <<<<
Title:    Screen Management System: Installation Options
Class:    #32770
Position:    231, 203
Size:    426, 292
Style:    0x94CA084C
ExStyle:    0x00010100
Handle:    0x00041490

>>>> Control <<<<
Class:    Button
Instance:    2
ClassnameNN:    Button2
Name:    
Advanced (Class):    [CLASS:Button; INSTANCE:2]
ID:    1
Text:    &Next >
Position:    335, 231
Size:    75, 23
ControlClick Coords:    42, 18
Style:    0x50010001
ExStyle:    0x00000004
Handle:    0x0057131A

>>>> Mouse <<<<
Position:    611, 478
Cursor ID:    2
Color:    0xF0F0F0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
&Next >
Cancel
Nullsoft Install System v3.0a2
Select components to install:
Space required: 325.8MB
Check the components you want to install and uncheck the components you don't want to install. Click Next to continue.


>>>> Hidden Text <<<<
Custom
 

Share this post


Link to post
Share on other sites
GSingh

I have tried WinWaitActive also instead of sleep but button is not pressed.

Share this post


Link to post
Share on other sites
Earthshine
Posted (edited)

try that

Local $hSetup = Run ("setup_REL_SMS_6_3_0.exe")

ControlClick ($hSetup, 'Screen Management System: Installation Options', '[CLASS:Button; INSTANCE:2]')

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
GSingh

Tried ControlClick ('[CLASS:#32770]', 'Screen Management System: Installation Options', '[CLASS:Button; INSTANCE:2]')

Application launches as before but "next" button is not pressed.

Share this post


Link to post
Share on other sites
Earthshine

we could try

WinWait($hSetup, 'Screen Management System: Installation Options')

instead of Sleep?


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
GSingh

Local $hSetup = Run ("setup_REL_SMS_6_3_0.exe")
WinWait($hSetup, 'Screen Management System: Installation Options')
ControlClick ($hSetup, 'Screen Management System: Installation Options', '[CLASS:Button; INSTANCE:2]')

 

Tried above but same issue :(

Share this post


Link to post
Share on other sites
Earthshine

I think @Junkew is right, you need to visit FAQ 31


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
junkew
Posted (edited)

Remove the text property or the instance property. I think you are now stating give me the 2nd button with caption text whereas there is only 1

Add also a consolewrite after run to make sure you reach the sleep command and your script is not blocked due to waiting for run getting finished.

Edited by junkew

Share this post


Link to post
Share on other sites
GSingh

Attached here is the screenshot of the dialog and there are 2 buttons "next" and "cancel".

1.jpg

Share this post


Link to post
Share on other sites
GSingh

Help please..

Share this post


Link to post
Share on other sites
junkew

ControlClick("Screen Management System: Installation Options", "", "[CLASS:BUTTON;; INSTANCE:2]")

or

ControlClick("Screen Management System: Installation Options", "", "[CLASS:BUTTON; TEXT:&Next >

ControlClick("Screen Management System: Installation Options", "", "[CLASS:BUTTON; TEXT:&Next >]")
ControlClick("Screen Management System: Installation Options", "", "[CLASS:BUTTON;; INSTANCE:2]")

]")

Share this post


Link to post
Share on other sites
JLogan3o13
2 hours ago, GSingh said:

Help please..

@GSingh first off, please wait 24 hours before bumping your post. This may be the most important thing in the world to you, but you need to show some patience.

Secondly, IF you are going to bump your post, the expectation would be that you have gone back and tried the suggestions given, and are reporting either success or failure of those suggestions. junkew suggested you do some reading on FAQ31, did you? Did you try anything after doing so? You have provided zero information outside of a screenshot to show that you are putting forth any effort. This forum is dedicated to helping with scripts, not spoon-feeding it to you.

Lastly, as this application was compiled with NullSoft, have you looked for command line parameters that will allow you to install silently with options? Perhaps if we knew the application, we could provide more assistance.


√-1 2^3 ∑ π, and it was delicious!

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

×