Forum Discussion

mspatel's avatar
mspatel
Contributor
8 years ago

Runner.CallObjectMethodAsync doesnt Work

Hi 

I am testing this Thick Client Application where i need to click on Leaf node of a Tree Object. Luckily Application under Testing has  few methods exposed which i am using to double click on particular node object. 

 

Since Synchronous Call to AUT method was halting the execution , i had to call method Asynchronously. Now the problem is doubleClicking is not happening. Method get executed and moves on to next Statement. 

 

I confirmed If i call method Synchronuosly Then it does perform the Double click , but then execution halts due to PopUp.

 

 

My Question is ....

What am i missing here in method Call ?  

Is anyone else facing the same issue with Async call ? 

Is there any alternative ? 

 

 

 

 

''Launch Profile
Set ProfileButtonMenu=Aliases.CharlesRiverIMS.MdiIms.MdiClient.BlotterFormBase.FormTabbedGroups.CrdTabControl.OrderBlotterViewControl.toolStripContainer.ToolStripPanel.Profile
Call ProfileButtonMenu.CrdShowToolbarButtonMenu("Profiles")
Set ProfileTree=Aliases.CharlesRiverIMS.ProfileDropDownMenu.ProfileTreeControl.ProfileTreeEditor
Set CallResultObj  = Runner.CallObjectMethodAsync (ProfileTree,"CrdDoubleClickTreeItem","Equity","AAM Equity Profile")

If i Call following way , It does perform the click

 

 

Sub Test1
  Dim charlesRiverIMS
  Dim crdToolStrip
  Dim profileTreeEditor
  Dim btnNo
  Set charlesRiverIMS = Aliases.CharlesRiverIMS
  Set crdToolStrip = charlesRiverIMS.MdiIms.MdiClient.BlotterFormBase.FormTabbedGroups.CrdTabControl.OrderBlotterViewControl.toolStripContainer.ToolStripPanel.Profile
  crdToolStrip.CrdClickToolbarButton("Profiles")
  Set profileTreeEditor = charlesRiverIMS.ProfileDropDownMenu.ProfileTreeControl.ProfileTreeEditor
  call profileTreeEditor.CrdDoubleClickTreeItem("Equity","AAM Equity Profile")
  Set btnNo = charlesRiverIMS.dlgSaveProfileJKINGDefault.btnNo
  btnNo.ClickButton
  log.Message "Done"
End Sub

 

 

1 Reply

  • JuliaBernikova's avatar
    JuliaBernikova
    SmartBear Alumni (Retired)

    Hi,

     

    It looks like the issue is related to the specifics of the native method you use: it can only return some value after you close the dialog window (the dlgSaveProfileJKINGDefault object). Otherwise, if the dialog window remains open, TestComplete keeps waiting till the method returns something. This is what makes TestComplete hang.

     

    It seems to me that no alternative is necessary since you managed to create a procedure which successfully clicks the item. However, you can also try using the DblClick action to simulate a double-click. If the tree item cannot be recognized by TestComplete as an individual object, you'll need to specify the coordinates of the item within the tree as the parameters of the DblClick action.