This project is read-only.

verifying items from popup

Oct 14, 2010 at 1:22 PM






i have a poup which contains 15 items and i want to verify all 15 items if they exist or not. So the code below works however the problem is if the Assert verification fails the next line code will not be executed. I want to know how i can resolve this problem. Is there any other way to verify all poup menu items?. Thanks a lot.



popupmenu = ModalWindow.Popup;



Menu menu = popupmenu.ItemBy(SearchCriteria.ByText("item1"));



Assert.IsTrue(menu.Visible, "item1 is visible", "item1");



Menu menu1 = popupmenu.ItemBy(SearchCriteria.ByText("item2));



Assert.IsTrue(menu1.Visible, "item2 is visible", "item2");

Oct 14, 2010 at 9:08 PM



use ErrorLog from (Thread)


List<string> expectedItems = new List<string>(){"item1", "item2",..."item15"};

List<string> error= new List<string>();

Menus menus = popupmenu.Items;

foreach(string menuItem in expectedItems)


   ErrorLog.Instance.Add(string.Format("Item {0} does not exist", menuItem);