当前位置: 首页>>代码示例>>C#>>正文


C# Window.Get方法代码示例

本文整理汇总了C#中TestStack.White.UIItems.WindowItems.Window.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Window.Get方法的具体用法?C# Window.Get怎么用?C# Window.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestStack.White.UIItems.WindowItems.Window的用法示例。


在下文中一共展示了Window.Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SelectListBoxItemByText

 //**************************************************************************************************************************************************************
 public static void SelectListBoxItemByText(Window win, String listBoxElementAutoID, String matchText)
 {
     try
     {
         TestStack.White.UIItems.ListBoxItems.ListBox l = win.Get<TestStack.White.UIItems.ListBoxItems.ListBox>(SearchCriteria.ByAutomationId(listBoxElementAutoID));
         List<TestStack.White.UIItems.ListBoxItems.ListItem> k = l.Items;
         foreach (var item in k)
         {
             if (item.Text.Equals(matchText) || item.Text.Contains(matchText))
             {
                 item.Focus();
                 //item.SetValue(matchText);
                 item.Click();
                 Thread.Sleep(int.Parse(Execution_Speed));
             }
         }
     }
     catch (Exception e)
     {
         String sMessage = e.Message;
         LastException.SetLastError(sMessage);
         throw new Exception(sMessage);
     }
 }
开发者ID:nhaloi,项目名称:QBWhiteFramework,代码行数:25,代码来源:Actions.cs

示例2: LoginModel

 public LoginModel(Window loginWindow)
 {
     loginTextBox = loginWindow.Get<TextBox>(SearchCriteria.ByAutomationId(LoginWindowIDs.LOGINTEXTBOX));
     passwordField = loginWindow.Get<TextBox>(SearchCriteria.ByAutomationId(LoginWindowIDs.PASSWORDTEXTBOX));
     clientField = loginWindow.Get<TextBox>(SearchCriteria.ByAutomationId(LoginWindowIDs.CLIENDTEXTBOX));
     rememberMeCheckBox = loginWindow.Get<CheckBox>(SearchCriteria.ByClassName(LoginWindowIDs.REMEMBERMECHECKBOX));
     loginButton = loginButton = loginWindow.Get<Button>(SearchCriteria.ByAutomationId(LoginWindowIDs.LOGINBUTTON));
 }
开发者ID:ZeroTull,项目名称:EC4,代码行数:8,代码来源:LoginModel.cs

示例3: DeskSelectionModel

 public DeskSelectionModel(Window window)
 {
     deskSelection = window.Get<ComboBox>(SearchCriteria.ByAutomationId(DeskSelectionIDs.DESKSELECTIONCOMBOBOX));
     makeMeImmediatlyAvailable = window.Get<CheckBox>(SearchCriteria.ByAutomationId(DeskSelectionIDs.MAKEMEIMMEDIATELYAVAILABLECHECKBOX));
     okButton = window.Get<Button>(SearchCriteria.ByAutomationId(DeskSelectionIDs.OKBUTTON));
     cancelButton = window.Get<Button>(SearchCriteria.ByAutomationId(DeskSelectionIDs.OKBUTTON));
     closeButton = window.Get<Button>(SearchCriteria.ByAutomationId(DeskSelectionIDs.CLOSEBUTTON));
 }
开发者ID:ZeroTull,项目名称:EC4,代码行数:8,代码来源:DeskSelectionModel.cs

示例4: FindControl

        /// <summary>
        /// given a criteria, find a control within a window
        /// </summary>
        /// <param name="window">the containing window</param>
        /// <param name="criteria">the criteria to find the control</param>
        /// <returns>the found control. null - if not found</returns>
        public IUIItem FindControl(Window window, Dictionary<string, string> criteria)
        {
            // the "all" condition
            SearchCriteria crit = SearchCriteria.All;

            // for each criteria, AND with a new condition
            foreach (string key in criteria.Keys)
            {
                switch (key.ToLower())
                {
                    case Constants.PropertyNames.ControlType:
                        crit = crit.AndControlType(GetTypeByName(criteria[key]));
                        break;
                    case Constants.PropertyNames.AutomationId:
                        crit = crit.AndAutomationId(criteria[key]);
                        break;
                    case Constants.PropertyNames.Text:
                        crit = crit.AndByText(criteria[key]);
                        break;
                    default:
                        return null;
                };
            }

            // search for control with 'crit'
            IUIItem item = window.Get(crit, WaitTime);

            // return the found control
            return item;
        }
开发者ID:divyang4481,项目名称:dotnetabt,代码行数:36,代码来源:UIAActionManager.cs

示例5: Slide

 public void Slide(Window window)
 {
     var thumb = window.Get<Thumb>("Splitter");
     var originalY = thumb.Location.Y;
     thumb.SlideVertically(50);
     Assert.Equal(originalY + 50, thumb.Location.Y);
 }
开发者ID:EricBlack,项目名称:White,代码行数:7,代码来源:VerticalThumbTest.cs

示例6: Slide

 public void Slide(Window window)
 {
     var thumb = window.Get<Thumb>("Splitter");
     double originalX = thumb.Location.X;
     thumb.SlideHorizontally(50);
     Assert.Equal(originalX + 50, thumb.Location.X);
 }
开发者ID:EricBlack,项目名称:White,代码行数:7,代码来源:HorizontalThumbTest.cs

示例7: OperationsPage

        public OperationsPage(Window window)
        {
            this.window = window;

            string[] operations = { "*", "/", "-", "+", "=" };

            operationButtons = operations.ToDictionary(o => o, o => window.Get<Button>(SearchCriteria.ByText(o)));
        }
开发者ID:jazz-any,项目名称:CalcUT,代码行数:8,代码来源:OperationsPage.cs

示例8: ResultPage

        public ResultPage(Window window)
        {
            this.window = window;

            var edits = window.GetMultiple(SearchCriteria.ByControlType(ControlType.Edit)).Cast<TextBox>().ToArray();
            resultField = edits.First(edit => edit.Text == "0");
            resultScreen = edits.First(edit => edit != resultField);
            resultButton = window.Get<Button>(SearchCriteria.ByText("="));
            okButtonCriteria = SearchCriteria.ByText("OK");
        }
开发者ID:jazz-any,项目名称:CalcUT,代码行数:10,代码来源:ResultPage.cs

示例9: WhiteWindowShim

 internal WhiteWindowShim(Window whiteWindow)
 {
     this._white = whiteWindow;
     try
     {
         if (_white.Exists<Label>())
             _text = _white.Get<Label>().Text;
     }
     catch { }
 }
开发者ID:peterson1,项目名称:ErrH,代码行数:10,代码来源:WhiteWindowShim.cs

示例10: NumbersPage

        public NumbersPage(Window window)
        {
            var symbolToButtonNameMappings = Enumerable.Range(0, 10)
                .Select(i => i.ToString()).Concat(new [] {"." })
                .ToDictionary(i => i, i => i);
            symbolToButtonNameMappings["-"] = "+/-";

            symbolButtons = symbolToButtonNameMappings
                .ToDictionary(mapping => mapping.Key,
                    mapping => window.Get<Button>(SearchCriteria.ByText(mapping.Value)));
        }
开发者ID:jazz-any,项目名称:CalcUT,代码行数:11,代码来源:NumbersPage.cs

示例11: CheckElementExistsByAutomationID

        //**************************************************************************************************************************************************************
        public static bool CheckElementExistsByAutomationID(Window win, String automationID)
        {
            bool exists = false;

            try
            {
                exists = win.Get(SearchCriteria.ByAutomationId(automationID)).Visible;
                Thread.Sleep(int.Parse(Execution_Speed));
                return exists;
            }
            catch (Exception e)
            {
                String sMessage = e.Message;
                LastException.SetLastError(sMessage);
                throw new Exception(sMessage);
            }
        }
开发者ID:nhaloi,项目名称:QBWhiteFramework,代码行数:18,代码来源:Actions.cs

示例12: SelectRadioButtonByName

        //**************************************************************************************************************************************************************
        public static void SelectRadioButtonByName(Window win, String radioButtonName)
        {
            try
            {
                AutomationProperty p = AutomationElementIdentifiers.NameProperty;
                TestStack.White.UIItems.RadioButton r = win.Get<TestStack.White.UIItems.RadioButton>(SearchCriteria.ByNativeProperty(p, radioButtonName));
                r.Select();
                Thread.Sleep(int.Parse(Execution_Speed));

            }
            catch (Exception e)
            {
                String sMessage = e.Message;
                LastException.SetLastError(sMessage);
                throw new Exception(sMessage);
            }
        }
开发者ID:nhaloi,项目名称:QBWhiteFramework,代码行数:18,代码来源:Actions.cs

示例13: FindCustomItem

 void FindCustomItem(Window window)
 {
     var myDateUIItem = window.Get<MyDateUIItem>("DateOfBirth");
     Assert.NotEqual(null, myDateUIItem);
     myDateUIItem.EnterDate(DateTime.Today);
 }
开发者ID:ashishjain76,项目名称:AutoConvertor,代码行数:6,代码来源:CustomUIItemTest.cs

示例14: ClickButtonByAutomationID

 //**************************************************************************************************************************************************************
 public static void ClickButtonByAutomationID(Window win, String automationID)
 {
     try
     {
         TestStack.White.UIItems.Button b = (TestStack.White.UIItems.Button) win.Get(SearchCriteria.ByAutomationId(automationID));
         b.Click();
         Thread.Sleep(int.Parse(Execution_Speed));
     }
     catch (Exception e)
     {
         String sMessage = e.Message;
         LastException.SetLastError(sMessage);
         throw new Exception(sMessage);
     }
 }
开发者ID:nhaloi,项目名称:QBWhiteFramework,代码行数:16,代码来源:Actions.cs

示例15: SelectRadioButton

        //**************************************************************************************************************************************************************
        public static void SelectRadioButton(Window win, String radioButtonAutoID)
        {
            try
            {
                TestStack.White.UIItems.RadioButton r = win.Get<TestStack.White.UIItems.RadioButton>(SearchCriteria.ByAutomationId(radioButtonAutoID));
                r.Select();
                Thread.Sleep(int.Parse(Execution_Speed));

            }
            catch (Exception e)
            {
                String sMessage = e.Message;
                LastException.SetLastError(sMessage);
                throw new Exception(sMessage);
            }
        }
开发者ID:nhaloi,项目名称:QBWhiteFramework,代码行数:17,代码来源:Actions.cs


注:本文中的TestStack.White.UIItems.WindowItems.Window.Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。