ChethanSG Posted February 11, 2019 Share Posted February 11, 2019 (edited) Hello Team, I am working on automating an installer package which prompts with a msgbox (yes/no) type in between. Auto it finds the message box and the Controlclick commands returns 1 but the message box continue to stay. Summary of the Control I am trying to click: >>>> Window <<<< Title: Install Finished Class: #32770 Position: 481, 173 Size: 357, 335 Style: 0x94C801C5 ExStyle: 0x00010101 Handle: 0x00D10362 >>>> Control <<<< Class: Button Instance: 1 ClassnameNN: Button1 Name: Advanced (Class): [CLASS:Button; INSTANCE:1]ID: 6 Text: &Yes Position: 149, 259 Size: 88, 26 ControlClick Coords: 39, 8 Style: 0x50030000 ExStyle: 0x00000004 Handle: 0x014302D0 >>>> Mouse <<<< Position: 677, 471 Cursor ID: 0 Color: 0xF0F0F0 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< &Yes &No Would you like to restart Tomcat server now? >>>> Hidden Text <<<< So far i have tried these options but none gave me result: #RequireAdmin is set Method 1: WinWait("Install Finished", "") WinActivate("Install Finished", "") ControlFocus("Install Finished", "",6) ControlSend("Install Finished", "",6, "{Enter}") Method 2: WinWait("Install Finished", "") WinActivate("Install Finished", "") ControlFocus("Install Finished", "",6) $Success=ControlClick("Install Finished", "", 6, "left", 1) Switch $Success Case 0 MsgBox(16,"Autoit","ControlClick Failed") Case 1 MsgBox(0,"Autoit","ControlClick Success") EndSwitch Note: This method returns 1(success) but nothing happens on the screen Method 3: WinSetState("Install Finished", "", @SW_ENABLE) WinActive("Install Finished", "") ControlSend("Install Finished", "", 6, "{ENTER}") Sleep(250) $title2 = "Install Finished"; the message title If WinExists($title2) Then WinActivate($title2) $check=WinWaitActive($title2) If($check) Then $yesHandle = ControlGetHandle($check, '', "[TEXT:&Yes]") ControlClick($check, "", $yesHandle) If($yesHandle) Then ControlFocus($yesHandle, "",6) ControlClick($yesHandle, "",6) MsgBox($MB_SYSTEMODAL, "", $yesHandle) EndIf EndIf EndIf Method 4: WinWaitActive("Install Finished", "") ControlClick ("[CLASS:#32770]", "&Yes", 6, "left", 1) Method 5: WinActivate("Install Finished", "") $handle = WinGetHandle("Install Finished", "&Yes") ControlSend("Install Finished","&Yes",$handle,"!y") Send("{Space}") While True if WinExists("Install Finished", "") Then WinActivate("Install Finished", "") Send("{Space}") EndIf WEnd ControlClick("Install Finished", "", "[Class:Button; INSTANCE:1]") None of these are closing the message box successfully even though the click is a success- Is there anything i am missing? Edited February 13, 2019 by ChethanSG Highlighting summary Link to comment Share on other sites More sharing options...
MetaSteel Posted February 11, 2019 Share Posted February 11, 2019 (edited) Something like this? WinWait("[CLASS:#32770; TITLE:Install Finished]", "Would you like to restart Tomcat server now?") ControlClick("[CLASS:#32770; TITLE:Install Finished]", "Would you like to restart Tomcat server now?", "[CLASS:Button; INSTANCE:1]") You'll want to make sure you read the help file for the title definition and control definition Edited February 12, 2019 by MetaSteel typo in code Link to comment Share on other sites More sharing options...
Developers Jos Posted February 11, 2019 Developers Share Posted February 11, 2019 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jdelaney Posted February 12, 2019 Share Posted February 12, 2019 Do you happen to have multiple windows with that title? IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
caramen Posted February 13, 2019 Share Posted February 13, 2019 HEllo Can you try this and say us? WinWait("[CLASS:#32770; TITLE:Install Finished]", "Would you like to restart Tomcat server now?") Sleep(500) ControlClick("[CLASS:#32770; TITLE:Install Finished]", "Would you like to restart Tomcat server now?", "[CLASS:Button; INSTANCE:1]","left",1) My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
ChethanSG Posted February 13, 2019 Author Share Posted February 13, 2019 (edited) On 2/12/2019 at 7:25 PM, jdelaney said: Do you happen to have multiple windows with that title? No.. its a single window 8 hours ago, caramen said: HEllo Can you try this and say us? WinWait("[CLASS:#32770; TITLE:Install Finished]", "Would you like to restart Tomcat server now?") Sleep(500) ControlClick("[CLASS:#32770; TITLE:Install Finished]", "Would you like to restart Tomcat server now?", "[CLASS:Button; INSTANCE:1]","left",1) Same result as earlier, the msg box doesnt close. The problem is not about identifying and clicking. The problem is even after the click is success (1 returned by ControlClick), the window remains and doesnot close at all! This is a msgbox of (Yes/No) type. And Yes button is having an id 6 Edited February 13, 2019 by ChethanSG Adding few more information Link to comment Share on other sites More sharing options...
Nine Posted February 13, 2019 Share Posted February 13, 2019 If you can't find a solution, then why don't you kill that window and restart the server yourself...big problem requires big solution “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
caramen Posted February 14, 2019 Share Posted February 14, 2019 (edited) nvm -.- Edited February 14, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
ChethanSG Posted February 14, 2019 Author Share Posted February 14, 2019 15 hours ago, Nine said: If you can't find a solution, then why don't you kill that window and restart the server yourself...big problem requires big solution This msgbox is displayed by a Wix Installer. I cant even kill this msgbox-even that fails. Killing process means killing the Installation itself. Note that this comes in the middle of installation, still few more steps are left before a complete installation. Very much required to address this, ,as this is going to be part of CI/CD Automated build deployments and Tests for every check-in Link to comment Share on other sites More sharing options...
caramen Posted February 14, 2019 Share Posted February 14, 2019 Why not a WinWait WinMove Then MouseClick My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Gianni Posted February 14, 2019 Share Posted February 14, 2019 (edited) ... following attempt seems to be missing, it is worth trying ... Local $hWinHandle = WinWait("Install Finished") ControlClick($hWinHandle, "", "[CLASS:Button; INSTANCE:1]") Edited February 14, 2019 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Earthshine Posted February 14, 2019 Share Posted February 14, 2019 (edited) Since this is an MSI you should install it silently Edited February 14, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
ChethanSG Posted February 25, 2019 Author Share Posted February 25, 2019 On 2/14/2019 at 3:37 PM, Earthshine said: Since this is an MSI you should install it silently Thanks, I went ahead with Silent install. Still why the script was unable to perform the action is a mystery 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