GSingh Posted May 31, 2018 Share Posted May 31, 2018 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 Link to comment Share on other sites More sharing options...
GSingh Posted May 31, 2018 Author Share Posted May 31, 2018 Just now, GSingh said: I forgot to check on notify me of replies. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 31, 2018 Moderators Share Posted May 31, 2018 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 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
GSingh Posted May 31, 2018 Author Share Posted May 31, 2018 Run ("setup_REL_SMS_6_3_0.exe") Sleep(5000) ControlClick("Screen Management System: Installation Options", "", "[CLASS:BUTTON; TEXT:&Next >; INSTANCE:2]") Link to comment Share on other sites More sharing options...
junkew Posted May 31, 2018 Share Posted May 31, 2018 See faq 31. Post also information of au3inf or other spy tools. Check functions like winwait instead of sleep. First test the basics on calc or notepad in help file examples so then you can apply same on your window. Earthshine 1 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...
GSingh Posted June 1, 2018 Author Share Posted June 1, 2018 >>>> 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 Link to comment Share on other sites More sharing options...
GSingh Posted June 1, 2018 Author Share Posted June 1, 2018 I have tried WinWaitActive also instead of sleep but button is not pressed. Link to comment Share on other sites More sharing options...
Earthshine Posted June 1, 2018 Share Posted June 1, 2018 (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 June 1, 2018 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
GSingh Posted June 1, 2018 Author Share Posted June 1, 2018 Tried ControlClick ('[CLASS:#32770]', 'Screen Management System: Installation Options', '[CLASS:Button; INSTANCE:2]') Application launches as before but "next" button is not pressed. Link to comment Share on other sites More sharing options...
Earthshine Posted June 1, 2018 Share Posted June 1, 2018 we could try WinWait($hSetup, 'Screen Management System: Installation Options') instead of Sleep? My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
GSingh Posted June 1, 2018 Author Share Posted June 1, 2018 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 Link to comment Share on other sites More sharing options...
Earthshine Posted June 1, 2018 Share Posted June 1, 2018 I think @Junkew is right, you need to visit FAQ 31 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
junkew Posted June 1, 2018 Share Posted June 1, 2018 (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 June 1, 2018 by junkew 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...
GSingh Posted June 1, 2018 Author Share Posted June 1, 2018 Attached here is the screenshot of the dialog and there are 2 buttons "next" and "cancel". Link to comment Share on other sites More sharing options...
GSingh Posted June 1, 2018 Author Share Posted June 1, 2018 Help please.. Link to comment Share on other sites More sharing options...
junkew Posted June 1, 2018 Share Posted June 1, 2018 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]") ]") 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...
Moderators JLogan3o13 Posted June 1, 2018 Moderators Share Posted June 1, 2018 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. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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