Forum Discussion

vijaynag's avatar
vijaynag
Occasional Contributor
6 years ago

Unable to click on Menu item present on Context menu - Windows Application

Hi,

 

I am facing a peculiar issue with my TestLeft scripts. The actions like clicking on the right click menu items or the popup which were working fine are now not working. They fail to click on the menu item after right click. Most of my scripts are failing because of that. 

 

This is happening on some machines. I have testleft version 12.50.4142.11 and Windows version 10 with latest updates.

 

Can someone throw light on what might be the issue?

 

Result StackTrace:
at SmartBear.TestLeft.TestObjects.ObjectWrapper.ThrowInvocationException(String name, Object[] parameters, WebApiError e)
at SmartBear.TestLeft.TestObjects.ObjectWrapper.CallMethod(String name, Object[] parameters)
at SmartBear.TestLeft.TestObjects.MenuWrapper.Click(String itemPath)

--------------

------------

----------------

 

--WebApiError
at SmartBear.TestLeft.WebApiWrapper.WebApiClient.ExecuteRequest[ResponseData](RestRequest request)
at SmartBear.TestLeft.WebApiWrapper.WebApiClient.CallMethod(Guid nodeKey, String methodName, IEnumerable`1 parameters)
at SmartBear.TestLeft.TestObjects.ObjectWrapper.CallMethod(String name, Object[] parameters)
Result Message:
SmartBear.TestLeft.TestObjects.InvocationException : Cannot obtain the popup menu for item 'Customer Service'.
Tested object: Sys.Process("Resolve").WinFormsObject("frmCP").WinFormsObject("ctlCasePerson").WinFormsObject("fraArrangement").WinFormsObject("pnlGenCF__LEID0").WinFormsObject("pnlGen__LEID454").WinFormsObject("pnlVLCF__LEID454").WinFormsObject("pnlVL__LEID455").WinFormsObject("pnlTabsCF__LEID455").WinFormsObject("pnlTabs__LEID477").WinFormsObject("pnlTabCF__LEID477").WinFormsObject("pnlTab__LEID479").WinFormsObject("pnlVLCF__LEID479").WinFormsObject("pnlVL__LEID2253").WinFormsObject("ctl__LEID2253").WinFormsObject("fraMain").WinFormsObject("ctlCaseIssueDetail").WinFormsObject("ctlFactMenu1").UltraMainMenu
----> SmartBear.TestLeft.WebApiWrapper.WebApiError : Cannot obtain the popup menu for item 'Customer Service'.
Tested object: Sys.Process("Resolve").WinFormsObject("frmCP").WinFormsObject("ctlCasePerson").WinFormsObject("fraArrangement").WinFormsObject("pnlGenCF__LEID0").WinFormsObject("pnlGen__LEID454").WinFormsObject("pnlVLCF__LEID454").WinFormsObject("pnlVL__LEID455").WinFormsObject("pnlTabsCF__LEID455").WinFormsObject("pnlTabs__LEID477").WinFormsObject("pnlTabCF__LEID477").WinFormsObject("pnlTab__LEID479").WinFormsObject("pnlVLCF__LEID479").WinFormsObject("pnlVL__LEID2253").WinFormsObject("ctl__LEID2253").WinFormsObject("fraMain").WinFormsObject("ctlCaseIssueDetail").WinFormsObject("ctlFactMenu1").UltraMainMenu

 

 

Thanks

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I'm moving this to the TestLeft community forums here...

     

    ... but since TestLeft DOES do things similar to TestComplete, my guess is that it is one of two things.

     

    1) A timing issue where you are attempting to interact with an object that hasn't been rendered or instantiated yet and, therefore, throw the error

    2) An object identification issue where something used to identify the object in question has changed or is different on the different machines.

     

    In looking over your stack trace, I'm aiming for option #1 here... it looks like you're attempting to click on a pop-up menu of another object... it's possible that the object in question hasn't been instatiated yet.  AGain, I'm not very familiar with TestLeft but I would guess that there is a way to drop in a hardcoded delay before the error command to diagnose the problem.  If that works, then... again, this is a guess, you might want to look at incorporating some sort of "Wait" methodology to wait for the desired object to be available before interacting with it.