Jump to content
deepSeeker

Script hangs after application pops up modal dialog of application not responding - (Moved)

Recommended Posts

deepSeeker

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.

 

Share this post


Link to post
Share on other sites
Melba23

Moved to the appropriate forum.

Moderation Team


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
careca

How can i reproduce this? I find it weird that it crashes for a simple combobox action.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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

Share this post


Link to post
Share on other sites
deepSeeker

Hi,

It is not Combobox or Controlcommand issue. 

My app is having some defect which is crashing during combo box selection and script hangs.

 

Share this post


Link to post
Share on other sites
careca

Put some error checking in place. Show us the code.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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

Share this post


Link to post
Share on other sites
deepSeeker
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.

 

Share this post


Link to post
Share on other sites
careca

Sry, Can't help. You shouldn't use 0.5 as timeout, use whole numbers, like was also stated in that post.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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

Share this post


Link to post
Share on other sites
jdelaney
Posted (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 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.

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

×