Menustrip and Contextmenu options

Ask general questions here.
gurpreet singh
Posts: 5
Joined: Wed Feb 06, 2013 9:02 am

Menustrip and Contextmenu options

Post by gurpreet singh » Fri Feb 08, 2013 7:08 am

1) How to check whether context menu and menustrip option are enabled or disabled.
e.g Edit > Copy (in menu strip)
2) How to check whether contex menu option is checked or unchecked(checkbox provided beside context menu option)

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Menustrip and Contextmenu options

Post by Support Team » Fri Feb 08, 2013 1:12 pm

Hi,
gurpreet singh wrote:1) How to check whether context menu and menustrip option are enabled or disabled.
e.g Edit > Copy (in menu strip)
gurpreet singh wrote: 2) How to check whether contex menu option is checked or unchecked(checkbox provided beside context menu option)
You can use the @enabled attribute to do this job. With this attribute you can check if the menu is enabled or disabled. And to check the checked state of your menu item you could use the @checked attribute of the menuitem.

Example RxPath:
menuitem[@name='Navigate Forward' and @enabled='False' and @checked='False']
Regards,
Peter
Ranorex Team
.
Image

gurpreet singh
Posts: 5
Joined: Wed Feb 06, 2013 9:02 am

Re: Menustrip and Contextmenu options

Post by gurpreet singh » Fri Feb 08, 2013 1:52 pm

thx Peter anyways .. but i forgot to mention that i'm using RanorexPython.
Do you have solution in RanorexPython.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Menustrip and Contextmenu options

Post by Support Team » Tue Feb 12, 2013 11:01 am

gurpreet singh wrote:but i forgot to mention that i'm using RanorexPython.
You are using Ranorex 1.5? Well, the solution should be similar, you need to search for an element with that state (enabled = false; checked = false).

However, Ranorex 1.X does not support RanoreXPath, so you need to search for that element using code. If you just started using Ranorex, I encourage you to update to the latest Ranorex release (we are currently at 4.0).

Regards,
Alex
Ranorex Team
.
Image