Click here to Skip to main content
13,095,218 members (77,580 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I am new in CodedUI and working in CodedUI for last few days.

In this I have to check whether a menuitem is enabled within a while loop and till this menuitem is enabled I have to perform some operation.

The code snnipet that I have written is:

WinMenuItem uIRemoveViewMenuItem = this.UIItemWindow.UIRemoveViewMenuItem;
while (uIRemoveViewMenuItem.Enabled)
//code to perform some operation

But Enabled property of "uIRemoveViewMenuItem" control is always true even when the menuitem is not enabled actually after some iteration.

Please provide some solution for this problem.
And please provide some documentation links useful for codedUI.

Posted 27-Sep-12 0:11am
Updated 27-Sep-12 0:15am
Malli_S 27-Sep-12 6:17am
Hi Chitresh, Please check whether you have enabled the code optimization. Because as 'uIRemoveViewMenuItem.Enabled' is not accessed/updated inside the 'while loop', the optimization may replace the code.
Chitresh Kumar 28-Sep-12 6:27am
firstly Thanks for reply,
Can you please let me know how to check whether code optimization is enabled or not.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100