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.
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.
相关文章推荐
- white学习14(官方网站的内容)
- white学习2(官方网站的内容)
- white学习15(官方网站的内容)
- white学习3(官方网站的内容)
- white学习4(官方网站的内容)
- white学习5(官方网站的内容)
- white学习7(官方网站的内容)
- white学习8(官方网站的内容)
- white学习9(官方网站的内容)
- white学习16(官方网站的内容)
- white学习10(官方网站的内容)
- white学习10(官方网站的内容)
- white学习13(官方网站的内容),介绍White.NUnit
- white学习12(官方网站的内容),介绍一个捕获元素工具UISpy
- 参考TinyOS官方网站学习建立新platform-yamp
- TensorFlow 中文资源精选,官方网站,安装教程,入门教程,实战项目,学习路径
- [Groovy] 学习Groovy的好网站(内容全面)
- 廖雪峰官方网站python学习笔记:第一个Pyhon程序
- 参考TinyOS官方网站学习基于printf库的打印调试
- 学习笔记 - EasyUI官方网站演示