Click here to Skip to main content
11,485,564 members (80,681 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: testing

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 1:11am
Edited 27-Sep-12 1:15am
(no name)26.8K
Malli_S at 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 at 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
0 Sergey Alexandrovich Kryukov 380
1 Maciej Los 365
2 Mehdi Gholam 160
3 Raje_ 145
4 Frankie-C 134
0 Sergey Alexandrovich Kryukov 8,819
1 OriginalGriff 7,982
2 Sascha Lefèvre 3,199
3 Maciej Los 2,841
4 Richard Deeming 2,370

Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2015
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