Forum Discussion

mspatel's avatar
8 years ago

Pop Up Halts Execution

I am trying to put automation Tests around a vendor product ( prob build using .Net) and ran into this weird situation. 

As result of some action , application displays popup menu to confirm change ( basically Switching between profiles) . Problem is when ever this popup comes up , execution just halts there...It does not error out. Only way to get out of this deadlock is , i manually click on PopUp and get rid of it. 


I have put in code to handle popup , but execution never gets there . 


 Please Note: 

This is Thick Client Application

I have tried adding "OverAlpping Wiindow Handler" ...It didnt help






Here is Code Snippet. 


Sub Testing

Call Aliases.CharlesRiverIMS.MdiIms.CrdMenuStrip.CrdClickMenuItem("Trader","Blotter","")
aqUtils.Delay 10000

''Launch Profile
Set ProfileButtonMenu=Aliases.CharlesRiverIMS.MdiIms.MdiClient.BlotterFormBase.FormTabbedGroups.CrdTabControl.OrderBlotterViewControl.toolStripContainer.ToolStripPanel.Profile
Call ProfileButtonMenu.CrdShowToolbarButtonMenu("Profiles")

aqUtils.Delay 2000
Set ProfileTree=  Aliases.CharlesRiverIMS.ProfileDropDownMenu.ProfileTreeControl.ProfileTreeEditor
Call ProfileTree.CrdDoubleClickTreeItem("Equity","Equity Manager")
aqUtils.Delay 2000

Sys.Process("CharlesRiverIMS").Window("#32770", "Save Profile*", 1).Window("Button", "&No", 2).ClickButton

Log.Message "DOne" 

End Sub


3 Replies

  • Suggestion....I would look at WaitWinFormsObject and Exist property rather than using 'Delay'. You specify an object to wait on and how long you want to wait for it before timing out. May reduce the time required for your test to execute and make it more reliable. You can also use FindChild to find controls inside your forms without long paths that may be brittle.


    Example (in Python but same ideas apply)...

    if Aliases.YourApp.WaitWinFormsObject("FormName", 10000).Exists:
            expectedForm = Aliases.YourApp.WinFormsObject("FormName")
            controlInForm = expectedForm.FindChild("WinFormsControlName", "myControl", 10)


    • AlexKaras's avatar
      Champion Level 3


      Considering even more optimization;) , I would eliminate obtaining tested object's reference twice.

      Instead of

      if Aliases.YourApp.WaitWinFormsObject("FormName", 10000).Exists:
              expectedForm = Aliases.YourApp.WinFormsObject("FormName")

      my preference is


      expectedForm = Aliases.YourApp.WaitWinFormsObject("FormName", 10000)
      if expectedForm.Exists: