deepSeeker Posted June 28, 2018 Share Posted June 28, 2018 Hello, I am trying to automate an application, and when I send a ControlCommand to change the value of a ComboBox the application pops up a modal dialog "Application not responding" and that I want to close through script to resume another testcase execution. However after doing the ControlCommand the script seems to hang and control is not executing my code. To check application not responding/hang issue, I am using AdlibRegister, which checks for such popup at 1sec. But as script hangs at ControlCommand, adlibregister is not getting executed. The piece of code that is having problems is something like: AutoItSetOption ("WinTitleMatchMode", 2) ... ControlCommand("program", "", 1000, "SetCurrentSelection", 1); this is executed ; AutoIt hangs here If WinWait("Error", "Error Message", 0.5) = 1 Then Send("{ENTER}") EndIf Can someone please help. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 28, 2018 Moderators Share Posted June 28, 2018 Moved to the appropriate forum. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
careca Posted June 28, 2018 Share Posted June 28, 2018 How can i reproduce this? I find it weird that it crashes for a simple combobox action. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
deepSeeker Posted June 28, 2018 Author Share Posted June 28, 2018 Hi, It is not Combobox or Controlcommand issue. My app is having some defect which is crashing during combo box selection and script hangs. Link to comment Share on other sites More sharing options...
careca Posted June 28, 2018 Share Posted June 28, 2018 Put some error checking in place. Show us the code. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
deepSeeker Posted June 29, 2018 Author Share Posted June 29, 2018 Local $hndCombo = ControlGetHandle($hWindow, "", "[CLASS:ComboBox; INSTANCE:2]") $index = ControlCommand("[TITLE:MyApp]","", "[CLASS:ComboBox; INSTANCE:2]","FindString","100%") ConsoleWrite (" Error while selecting 2" & $index &@CRLF) ;Application hangs at below statement and control doesnt come until pressed "Close Program" manually. ControlCommand("[TITLE:MyApp]","", "[CLASS:ComboBox; INSTANCE:2]", "SetCurrentSelection", $index) I found related post which was posted long back. My problem is exactly this, but I couldn't understand how it has been solved by person who posted it. https://www.autoitscript.com/forum/topic/76363-script-hangs-after-application-pops-up-modal-dialog/ Any suggestion would help a lot. Thank you. Link to comment Share on other sites More sharing options...
careca Posted June 29, 2018 Share Posted June 29, 2018 Sry, Can't help. You shouldn't use 0.5 as timeout, use whole numbers, like was also stated in that post. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
jdelaney Posted June 29, 2018 Share Posted June 29, 2018 (edited) You can execute the controlcommand via run. then that new process is deadlocked while your script may proceed. there are examples in the help file under 'command line arguments': something like autoitexcecuteline or something similar. formatting the quotes can be a bit tricky, but easy to test via command line. I'll add an example when I get home. Edited June 29, 2018 by jdelaney 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...
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