Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

C#
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
Updated 27-Sep-12 0:15am
v2
Comments
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    
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900