Page 1 of 1

Not able to Recoginze ContextMenu

Posted: Tue Dec 01, 2009 7:15 am
by pjaddu
Hello Team ,

I have requirement like there will be button when i clicked that then a context menu will be displayed and i will select an item from that.
This action i have done through the Recording Procedure and Ranorex done that as well.
It stored all the things in the Repository. i.e There is Folder "ContextMenuMenuPopUp" and with in that "MenuItemMenuItem1".

Now the Problem i am facing is that I tried to Automate This Procedure using c# Script. when i Tried to TypeCast the "ContextMenuMenuPopUp" as ContextMenu . It is Throwing an error as
"Cannot Convert ContextMenuPopupFolder" to "Ranorexr.ContextMenu" via a reference conversion,boxing conversion,unboxingconversion,wrappingconversion, or null type conversion (CS0039).

Kindly Request you to give the solution for this.

Regards,
Phani

Re: Not able to Recoginze ContextMenu

Posted: Tue Dec 01, 2009 7:00 pm
by Support Team
For folders you need to use the folder's Self property to get the element corresponding to that folder:
ContextMenu menu = repo.ContextMenuMenuPopUp.Self;
See following topic in the Ranorex User Guide for more information:
http://www.ranorex.com/support/user-gui ... html#c1802

Regards,
Alex
Ranorex Support Team