Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: testing
Hi,

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.
 

Thanks
Chitresh
Posted 27-Sep-12 1:11am
Edited 27-Sep-12 1:15am
(no name)25.8K
v2
Comments
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
   
Hi
firstly Thanks for reply,
Can you please let me know how to check whether code optimization is enabled or not.
 

Thanks

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

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 210
2 BillWoodruff 205
3 Jochen Arndt 180
4 DamithSL 165
0 OriginalGriff 5,130
1 DamithSL 4,157
2 Maciej Los 3,670
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,821


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2014
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