您的位置:首页 > 运维架构 > 网站架构

white学习6(官方网站的内容)

2011-04-26 14:02 316 查看
A menu bar is part of a window, while a popup menu can be shown on a window. Other than this difference, the two types of menus behave in a consistent way, as far as a user is concerned. Both of them are composed of click-able menu items.

First, let's look at how menu bar items and popup menu items can be retrieved so White can click on them.
//POP UP MENU
window.Get<ListBox>("listBoxWithPopup").RightClick();
PopupMenu popupMenu = window.Popup;
Menu level2Menu = popupMenu.Item("Root", "Level1", "Level2");
level2Menu = popupMenu.ItemBy(SearchCriteria.ByText("Root"), SearchCriteria.ByText("Level1"), SearchCriteria.ByText("Level2")); //can use any other search criteria as well.

//MENU BAR
MenuBar menuBar = window.MenuBar;
Menu level2Menu = menuBar.MenuItem("Root", "Level1", "Level2");
level2Menu = menuBar.MenuItemBy(SearchCriteria.ByText("Root"), SearchCriteria.ByText("Level1"), SearchCriteria.ByText("Level2")); //can use any other search criteria as well.

level2Menu.Click();

"Root" is one of the menus in the first level, "Level1" is inside "Root" menu and "Level2" is inside "Level1". So on.
"Root", etc are text of the menu visible to user.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: