/// <summary> /// Payment - Use 'PaymentParams' to pass parameters into this method. /// </summary> public void Payment() { #region Variable Declarations WpfButton uIPayButton = this.UIBuildaBikeWindow.UIPayButton; WpfEdit uITxtb_nameEdit = this.UICustomerWindow.UITxtb_nameEdit; WpfEdit uITxtb_addressEdit = this.UICustomerWindow.UITxtb_addressEdit; WpfEdit uITxtb_emailEdit = this.UICustomerWindow.UITxtb_emailEdit; WpfButton uIPayButton1 = this.UICustomerWindow.UIPayButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; #endregion // Click 'Pay' button Mouse.Click(uIPayButton, new Point(29, 10)); // Type 'Richard Borbely' in 'txtb_name' text box uITxtb_nameEdit.Text = this.PaymentParams.UITxtb_nameEditText; // Type 'Edinburgh' in 'txtb_address' text box uITxtb_addressEdit.Text = this.PaymentParams.UITxtb_addressEditText; // Type '*****@*****.**' in 'txtb_email' text box uITxtb_emailEdit.Text = this.PaymentParams.UITxtb_emailEditText; // Click 'Pay' button Mouse.Click(uIPayButton1, new Point(24, 14)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(33, 14)); }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WinEdit uINameEdit = this.UIDebugWindow.UIItemWindow.UIDigital_docs_wpfListItem.UINameEdit; WpfEdit uILoginBoxEdit = this.UILoginViewWindow.UILoginBoxEdit; WpfEdit uIPasswordBoxEdit = this.UILoginViewWindow.UIPasswordBoxEdit; WpfButton uISigninButton = this.UILoginViewWindow.UISigninButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinButton uICloseButton = this.UILoginViewWindow1.UICloseButton; #endregion // Double-Click 'Name' text box Mouse.DoubleClick(uINameEdit, new Point(106, 8)); // Type 'test1' in 'LoginBox' text box uILoginBoxEdit.Text = this.RecordedMethod1Params.UILoginBoxEditText; // Type '{Tab}' in 'LoginBox' text box Keyboard.SendKeys(uILoginBoxEdit, this.RecordedMethod1Params.UILoginBoxEditSendKeys, ModifierKeys.None); // Type '********' in 'PasswordBox' text box Keyboard.SendKeys(uIPasswordBoxEdit, this.RecordedMethod1Params.UIPasswordBoxEditSendKeys, true); // Click 'Sign in' button Mouse.Click(uISigninButton, new Point(25, 7)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(92, 7)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(29, 16)); }
public void CodedUITestMethod1() { // Arrange var path = @"C:\Kurse\Testing\2017_08_22_SoftwareTests_Burghausen\HalloWPF\bin\Debug\HalloWPF.exe"; var app = ApplicationUnderTest.Launch(path); var mainWindow = new WpfWindow(app); mainWindow.SearchProperties.Add(WpfWindow.PropertyNames.Name, "halloWPFWindow"); var inputTextBox = new WpfEdit(mainWindow); inputTextBox.SearchProperties.Add(WpfEdit.PropertyNames.AutomationId, "inputTextBox"); var outputTextBlock = new WpfText(mainWindow); outputTextBlock.SearchProperties.Add(WpfText.PropertyNames.AutomationId, "outputTextBlock"); var inputButton = new WpfButton(mainWindow); inputButton.SearchProperties.Add(WpfButton.PropertyNames.AutomationId, "inputButton"); var outputCheckBox = new WpfCheckBox(mainWindow); outputCheckBox.SearchProperties.Add(WpfCheckBox.PropertyNames.AutomationId, "outputCheckBox"); // Act Keyboard.SendKeysDelay = 500; Keyboard.SendKeys(inputTextBox, "Hallo WPF from coded UI Test."); Mouse.Click(inputButton); // Assert Assert.AreEqual("Hallo WPF from coded UI Test.", outputTextBlock.DisplayText); Assert.IsTrue(outputCheckBox.Checked); }
/// <summary> /// SimulatronUITest - Use 'SimulatronUITestParams' to pass parameters into this method. /// </summary> public void SimulatronUITest() { #region Variable Declarations WinButton uIShowdesktopButton = this.UIItemWindow.UIShowdesktopButton; WpfCheckBox uICheckBoxCheckBox = this.UISimulatronWindowWindow.UICheckBoxCheckBox; WpfExpander uITemperatureExpander = this.UISimulatronWindowWindow.UITemperatureExpander; WpfButton uIResetButton = this.UISimulatronWindowWindow.UIResetButton; WinWindow uISimulatronWindowWindow1 = this.UISimulatronWindowWindow1; WpfTitleBar uISimulatronWindowTitleBar = this.UISimulatronWindowWindow.UISimulatronWindowTitleBar; #endregion // Click 'Show desktop' button Mouse.Click(uIShowdesktopButton, new Point(40, 12)); // Launch 'D:\Media\Univer\Labs\Git\IDE\Lab#2\Lab2\Lab2\bin\Debug\Lab2.exe' ApplicationUnderTest uISimulatronWindowWindow = ApplicationUnderTest.Launch(this.SimulatronUITestParams.UISimulatronWindowWindowExePath, this.SimulatronUITestParams.UISimulatronWindowWindowAlternateExePath); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.SimulatronUITestParams.UICheckBoxCheckBoxChecked; // Expand 'Temperature' expander uITemperatureExpander.Expanded = this.SimulatronUITestParams.UITemperatureExpanderExpanded; // Click 'Reset' button Mouse.Click(uIResetButton, new Point(32, 16)); // Double-Click 'SimulatronWindow' window Mouse.DoubleClick(uISimulatronWindowWindow1, new Point(1034, 343)); // Click 'SimulatronWindow' title bar Mouse.Click(uISimulatronWindowTitleBar, new Point(1137, -1)); }
/// <summary> /// additionTwoValues /// </summary> public void additionTwoValues() { #region Variable Declarations WpfButton uIItem5Button = this.UIMyCalculatorv1Window.UIItem5Button; WpfButton uIItem8Button = this.UIMyCalculatorv1Window.UIItem8Button; WpfButton uIItem7Button = this.UIMyCalculatorv1Window.UIItem7Button; WpfButton uIItemButton = this.UIMyCalculatorv1Window.UIItemButton; WpfButton uIItem2Button = this.UIMyCalculatorv1Window.UIItem2Button; WpfButton uIItemButton1 = this.UIMyCalculatorv1Window.UIItemButton1; #endregion // Click '5' button Mouse.Click(uIItem5Button, new Point(24, 8)); // Click '8' button Mouse.Click(uIItem8Button, new Point(28, 18)); // Click '7' button Mouse.Click(uIItem7Button, new Point(33, 20)); // Click '*' button Mouse.Click(uIItemButton, new Point(30, 18)); // Click '2' button Mouse.Click(uIItem2Button, new Point(16, 13)); // Click '=' button Mouse.Click(uIItemButton1, new Point(61, 12)); }
public void CodedUITestMethod1() { var mainWindow = GetMainWindow(); var btn = new WpfButton(mainWindow); btn.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "btn_AddShape")); btn.Find(); btn.WaitForControlReady(); Mouse.Click(btn); var diagram = new WpfCustom(mainWindow); diagram.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "diagram")); diagram.Find(); diagram.WaitForControlReady(); var element = new WpfCustom(diagram); element.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "CustomElement_1")); element.Find(); element.WaitForControlReady(); var itemsControl = new WpfList(element); itemsControl.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "itemsC")); //The CodedUI can't find the ItemsControl itemsControl.Find(); itemsControl.WaitForControlReady(); var items = itemsControl.Items.OfType <WpfListItem>().ToArray(); string[] s = items.Select(x => x.AutomationId).ToArray(); s.Should().BeEquivalentTo("ItemA", "ItemB", "ItemC", "ItemD", "ItemE", "ItemF", "ItemG", "ItemH"); }
/// <summary> /// AddingSupplyItem_QuantityMethod - Use 'AddingSupplyItem_QuantityMethodParams' to pass parameters into this method. /// </summary> public void AddingSupplyItem_QuantityMethod() { #region Variable Declarations WpfCheckBox uISupplyCheckBox = this.UICareTendWindow.UISupplyCheckBox; WpfButton uIApplyButton = this.UICareTendWindow.UIApplyButton; WpfCell uIAdhesiveRemoverWipe5Cell = this.UICareTendWindow.UIItemCustom1.UIDgResultsTable.UIRow_1Row.UIAdhesiveRemoverWipe5Cell; WpfCell uIItemDHSClientContracCell = this.UICareTendWindow.UIItemCustom.UITabsControlTabList.UIDeliveryTicketItemsTabPage.UIDgItemsTable.UIRow_0Row.UIItemDHSClientContracCell; WpfButton uISaveCloseButton = this.UICareTendWindow.UISaveCloseButton; #endregion // Select 'Supply' check box uISupplyCheckBox.Checked = this.AddingSupplyItem_QuantityMethodParams.UISupplyCheckBoxChecked; Playback.Wait(5000); // Click 'Apply' button Mouse.Click(uIApplyButton, new Point(19, 1)); Playback.Wait(5000); // Type '{Enter}' in 'Adhesive Remover Wipe (50/bx)' cell Keyboard.SendKeys(uIAdhesiveRemoverWipe5Cell, this.AddingSupplyItem_QuantityMethodParams.UIAdhesiveRemoverWipe5CellSendKeys, ModifierKeys.None); Playback.Wait(5000); // Type '30' in 'Item: DHS.Client.Contracts.DeliveryTicketItemDataO...' cell //uIItemDHSClientContracCell.Value = this.AddingSupplyItem_QuantityMethodParams.UIItemDHSClientContracCellValue; Keyboard.SendKeys("30"); // Click 'Save & Close' button Mouse.Click(uISaveCloseButton, new Point(11, 6)); Playback.Wait(5000); }
public void CodedUITestMethod1() { var mainWindow = GetMainWindow(); var btn = new WpfButton(mainWindow); btn.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "btn_AddShape")); btn.Find(); btn.WaitForControlReady(); Mouse.Click(btn); var diagram = new WpfCustom(mainWindow); diagram.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "diagram")); diagram.Find(); diagram.WaitForControlReady(); var element = new WpfCustom(diagram); element.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "CustomElement_1")); element.Find(); element.WaitForControlReady(); var itemsControl = new WpfList(element); itemsControl.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "itemsC")); //The CodedUI can't find the ItemsControl itemsControl.Find(); itemsControl.WaitForControlReady(); string[] s = itemsControl.Items.GetValuesOfControls(); }
/// <summary> /// Positivtest2 - Verwenden Sie "Positivtest2Params", um Parameter an diese Methode zu übergeben. /// </summary> public void Positivtest2() { #region Variable Declarations WinEdit uINameEdit = this.UIDebugWindow.UIItemWindow.UIM120LB2FS17ListItem.UINameEdit; WpfListItem uISystemDynamicExpandoListItem = this.UIMainWindowWindow.UILb_vermietungList.UISystemDynamicExpandoListItem; WpfText uIItem6102017110000AMText = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem2Row.UIItem6102017110000AMCell.UIItem6102017110000AMText; WinList uIElementansichtList = this.UIDebugWindow.UIShellViewWindow.UIShellViewClient.UIElementansichtList; WpfButton uIHauptmenuButton = this.UIMainWindowWindow.UIItemCustom.UIHauptmenuButton; WinButton uISchließenButton = this.UIMainWindowWindow1.UISchließenButton; #endregion // Doppelklicken "Name" Textfeld Mouse.DoubleClick(uINameEdit, new Point(116, 12)); // Klicken "System.Dynamic.ExpandoObject" Listenelement Mouse.Click(uISystemDynamicExpandoListItem, new Point(186, 7)); // Klicken "6/10/2017 11:00:00 AM" Bezeichnung Mouse.Click(uIItem6102017110000AMText, new Point(41, 10)); // "{NumPad7}{Divide}{NumPad6}{Divide}{NumPad2}{NumPad0}{NumPad4}{Back}{NumPad1}{NumPad7}{Space}{NumPad1}{NumPad2}{NumPad0}{Back}{LShiftKey}:00{Tab}" in "Elementansicht" Listenfeld eingeben Keyboard.SendKeys(uIElementansichtList, this.Positivtest2Params.UIElementansichtListSendKeys, ModifierKeys.None); // "{NumPad7}{Divide}{NumPad6}{Divide}{NumPad2}{NumPad0}{NumPad1}{NumPad7}{Space}{NumPad1}{NumPad8}{LShiftKey}:30" in "Elementansicht" Listenfeld eingeben Keyboard.SendKeys(uIElementansichtList, this.Positivtest2Params.UIElementansichtListSendKeys1, ModifierKeys.None); // "{Enter}" in "Elementansicht" Listenfeld eingeben Keyboard.SendKeys(uIElementansichtList, this.Positivtest2Params.UIElementansichtListSendKeys2, ModifierKeys.None); // Klicken "Hauptmenu" Schaltfläche Mouse.Click(uIHauptmenuButton, new Point(259, 7)); // Klicken "Schließen" Schaltfläche Mouse.Click(uISchließenButton, new Point(14, 16)); }
/// <summary> /// AddOrder_3 - Use 'AddOrder_3Params' to pass parameters into this method. /// </summary> public void AddOrder_3() { #region Variable Declarations WpfComboBox uIComboBox_frameSizeComboBox = this.UIBuildaBikeWindow.UIComboBox_frameSizeComboBox; WpfComboBox uIComboBox_frameColourComboBox = this.UIBuildaBikeWindow.UIComboBox_frameColourComboBox; WpfComboBox uIComboBox_gearsBreaksComboBox = this.UIBuildaBikeWindow.UIComboBox_gearsBreaksComboBox; WpfComboBox uIComboBox_wheelsComboBox = this.UIBuildaBikeWindow.UIComboBox_wheelsComboBox; WpfComboBox uIComboBox_handlebarSaComboBox = this.UIBuildaBikeWindow.UIComboBox_handlebarSaComboBox; WpfCheckBox uIExtendwarrantyCheckBox = this.UIBuildaBikeWindow.UIExtendwarrantyCheckBox; WpfButton uIAddButton = this.UIBuildaBikeWindow.UIAddButton; #endregion // Select 'Large' in 'comboBox_frameSize' combo box uIComboBox_frameSizeComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_frameSizeComboBoxSelectedItem; // Select 'Black' in 'comboBox_frameColour' combo box uIComboBox_frameColourComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_frameColourComboBoxSelectedItem; // Select 'Group Set 3 (Campagnolo, Clarks)' in 'comboBox_gearsBreaks' combo box uIComboBox_gearsBreaksComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_gearsBreaksComboBoxSelectedItem; // Select 'DT Swiss' in 'comboBox_wheels' combo box uIComboBox_wheelsComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_wheelsComboBoxSelectedItem; // Select 'Group Set 2 (Race Face, Fizik Arione)' in 'comboBox_handlebarSaddle' combo box uIComboBox_handlebarSaComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_handlebarSaComboBoxSelectedItem; // Select 'Extend warranty' check box uIExtendwarrantyCheckBox.Checked = this.AddOrder_3Params.UIExtendwarrantyCheckBoxChecked; // Click 'Add' button Mouse.Click(uIAddButton, new Point(13, 19)); }
private WpfButton FeedbackWindow_CancelButton() { WpfButton theButton = new WpfButton(GetFeedbackWindow()); theButton.SearchProperties[WpfButton.PropertyNames.AutomationId] = "FeebackView_Cancel"; theButton.Find(); return theButton; }
/// <summary> /// FetchUser2 - Use 'FetchUser2Params' to pass parameters into this method. /// </summary> public void FetchUser2() { #region Variable Declarations WinEdit uINameEdit = this.UIDebugWindow.UIItemWindow.UIDigital_docs_wpfListItem.UINameEdit; WpfEdit uILoginBoxEdit = this.UILoginViewWindow.UILoginBoxEdit; WpfEdit uIPasswordBoxEdit = this.UILoginViewWindow.UIPasswordBoxEdit; WpfButton uISigninButton = this.UILoginViewWindow.UISigninButton; WpfButton uIFetchoffersButton = this.UIUser234_InProgressWindow.UIFetchoffersButton; WinButton uICloseButton = this.UIUser234_InProgressWindow1.UICloseButton; #endregion // Double-Click 'Name' text box Mouse.DoubleClick(uINameEdit, new Point(52, 17)); // Type 'user2' in 'LoginBox' text box uILoginBoxEdit.Text = this.FetchUser2Params.UILoginBoxEditText; // Type '{Tab}' in 'LoginBox' text box Keyboard.SendKeys(uILoginBoxEdit, this.FetchUser2Params.UILoginBoxEditSendKeys, ModifierKeys.None); // Type '********' in 'PasswordBox' text box Keyboard.SendKeys(uIPasswordBoxEdit, this.FetchUser2Params.UIPasswordBoxEditSendKeys, true); // Click 'Sign in' button Mouse.Click(uISigninButton, new Point(51, 29)); // Click 'Fetch offers' button Mouse.Click(uIFetchoffersButton, new Point(36, 9)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(49, 18)); }
public void AddRemoveRow() { var window = new WpfWindow(); window.SearchProperties[WpfWindow.PropertyNames.Name] = "C1FlexGrid Automation Test"; var btn_AddRow = new WpfButton(window); btn_AddRow.SearchProperties[WpfButton.PropertyNames.AutomationId] = "btn_AddRow"; var btn_RemoveRow = new WpfButton(window); btn_RemoveRow.SearchProperties[WpfButton.PropertyNames.AutomationId] = "btn_RemoveRow"; var flexgrid = new WpfTable(window); flexgrid.SearchProperties[WpfTable.PropertyNames.AutomationId] = "flexgrid"; var msg = "Default:" + flexgrid.RowCount; Mouse.Click(btn_AddRow); Mouse.Click(btn_AddRow); msg += ".AfterAddingTwoRows:" + flexgrid.RowCount; Mouse.Click(btn_RemoveRow); Mouse.Click(btn_RemoveRow); msg += ".AfterRemovingTwoRows:" + flexgrid.RowCount; Assert.AreEqual("Default:10.AfterAddingTwoRows:12.AfterRemovingTwoRows:10", msg); }
public WpfButton Get_Button(string AutomationId) { var btn = new WpfButton(Get_Window()); btn.SearchProperties[WpfButton.PropertyNames.AutomationId] = AutomationId; return(btn); }
/// <summary> /// SendMail2 - Use 'SendMail2Params' to pass parameters into this method. /// </summary> public void SendMail2() { #region Variable Declarations WinTitleBar uIDebugTitleBar = this.UIDebugWindow.UIDebugTitleBar; WinEdit uINameEdit = this.UIDebugWindow.UIItemWindow.UIDigital_docs_wpfListItem.UINameEdit; WpfEdit uILoginBoxEdit = this.UILoginViewWindow.UILoginBoxEdit; WpfEdit uIPasswordBoxEdit = this.UILoginViewWindow.UIPasswordBoxEdit; WpfButton uISigninButton = this.UILoginViewWindow.UISigninButton; WpfButton uIFetchoffersButton = this.UIUser1_NewTasksWindow.UIFetchoffersButton; WpfCell uIMailSubject8832Cell = this.UIUser1_NewTasksWindow.UIListViewTable.UIItemDataItem.UIMailSubject8832Cell; WpfCheckBox uIEmployee2CheckBox = this.UIUser1_NewTasksWindow.UIEmployee2CheckBox; WpfButton uIAcceptButton = this.UIUser1_NewTasksWindow.UIAcceptButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WpfEdit uIProductListTextBoxEdit = this.UIExcelDialogWindow.UIProductListTextBoxEdit; WpfButton uIOKButton1 = this.UIExcelDialogWindow.UIOKButton; WinButton uICloseButton = this.UIUser1_NewTasksWindow1.UICloseButton; #endregion // Click 'Debug' title bar Mouse.Click(uIDebugTitleBar, new Point(545, 18)); // Double-Click 'Name' text box Mouse.DoubleClick(uINameEdit, new Point(73, 20)); // Type 'user1' in 'LoginBox' text box uILoginBoxEdit.Text = this.SendMail2Params.UILoginBoxEditText; // Type '{Tab}' in 'LoginBox' text box Keyboard.SendKeys(uILoginBoxEdit, this.SendMail2Params.UILoginBoxEditSendKeys, ModifierKeys.None); // Type '********' in 'PasswordBox' text box Keyboard.SendKeys(uIPasswordBoxEdit, this.SendMail2Params.UIPasswordBoxEditSendKeys, true); // Click 'Sign in' button Mouse.Click(uISigninButton, new Point(12, 34)); // Click 'Fetch offers' button Mouse.Click(uIFetchoffersButton, new Point(102, 43)); // Click 'mailSubject8832' cell Mouse.Click(uIMailSubject8832Cell, new Point(64, 10)); // Select 'Employee #2' check box uIEmployee2CheckBox.Checked = this.SendMail2Params.UIEmployee2CheckBoxChecked; // Click 'Accept' button Mouse.Click(uIAcceptButton, new Point(63, 54)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(44, 6)); // Type '1,2' in 'productListTextBox' text box uIProductListTextBoxEdit.Text = this.SendMail2Params.UIProductListTextBoxEditText; // Click 'OK' button Mouse.Click(uIOKButton1, new Point(88, 15)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(21, 19)); }
public void ClickDatasetPageButton(string page) { var button = new WpfButton(); switch (page) { case "<<": button = ExcelClient1().UIQuandlExcelAddincompPane.UIItemButton; break; case "<": button = ExcelClient1().UIQuandlExcelAddincompPane.UIItemButton1; break; case ">>": button = ExcelClient1().UIQuandlExcelAddincompPane.UIItemButton3; break; default: button = ExcelClient1().UIQuandlExcelAddincompPane.UIItemButton2; break; } Mouse.Click(button); }
/// <summary> /// Creat new meal /// </summary> public void CreateMeal(string mealName, string descrtiption) { #region Variable Declarations WpfButton uIHljedláButton = this.UIMainWindowWindow1.UIHljedláButton; WpfButton uIPridaťButton = this.UIMainWindowWindow1.UIFramePane.UIPridaťButton; WpfEdit uIItemNameEdit = this.UIMainWindowWindow1.UIItemNameEdit; WpfEdit uIDescriptionEdit = this.UIMainWindowWindow1.UIDescriptionEdit; WpfButton uIUložiťButton = this.UIMainWindowWindow1.UIUložiťButton; WpfButton uIZatvoriťButton = this.UIMainWindowWindow1.UIZatvoriťButton; #endregion // Click 'Hl. jedlá' button Mouse.Click(uIHljedláButton, new Point(105, 16)); // Click 'Pridať' button Mouse.Click(uIPridaťButton, new Point(38, 23)); // Type 'Testovaci' in 'ItemName' text box uIItemNameEdit.Text = mealName; // Type '{Tab}' in 'ItemName' text box Keyboard.SendKeys(uIItemNameEdit, this.CreateMealParams.UIItemNameEditSendKeys, ModifierKeys.None); // Type 'Opis testovacieho jedla' in 'Description' text box uIDescriptionEdit.Text = descrtiption; // Click 'Uložiť' button Mouse.Click(uIUložiťButton, new Point(75, 13)); // Click 'Zatvoriť' button Mouse.Click(uIZatvoriťButton, new Point(114, 23)); }
public void LoginServer() { WpfWindow mainWindow = new WpfWindow(); mainWindow.SearchProperties[WpfWindow.PropertyNames.Name] = "Service Manager20.1 20.1.86.107687 (20.1)"; mainWindow.WindowTitles.Add("Service Manager20.1 20.1.86.107687 (20.1)"); UITestControl parent = new UITestControl(mainWindow); parent.WindowTitles.Add("Service Manager20.1 20.1.86.107687 (20.1)"); parent.TechnologyName = "MSAA"; parent.SearchProperties.Add("ControlType", "MenuBar"); parent.SearchProperties[WpfButton.PropertyNames.Name] = "Tools"; WpfButton Actions = new WpfButton(parent); Actions.WindowTitles.Add("Service Manager20.1 20.1.86.107687 (20.1)"); Actions.TechnologyName = "MSAA"; Actions.SearchProperties.Add("ControlType", "MenuItem"); Actions.SearchProperties[WpfButton.PropertyNames.Name] = "Actions"; Mouse.Click(Actions); WpfButton Login = new WpfButton(Actions); Actions.WindowTitles.Add("Service Manager20.1 20.1.86.107687 (20.1)"); Actions.TechnologyName = "MSAA"; Actions.SearchProperties.Add("ControlType", "MenuItem"); Actions.SearchProperties[WpfButton.PropertyNames.Name] = "Login"; Mouse.Click(Login); Playback.Wait(10000); }
/// <summary> /// Open user and modify his city /// </summary> public void EditUser() { #region Variable Declarations WinTitleBar uIMainWindowTitleBar = this.UIMainWindowWindow.UIMainWindowTitleBar; WpfButton uIUžívateliaButton = this.UIMainWindowWindow1.UIUžívateliaButton; WpfText uIVyskocanyText = this.UIMainWindowWindow1.UIFramePane.UIClientSelectTable.UIVyskocanyMatoRow.UIVyskocanyCell.UIVyskocanyText; WinWindow uIMainWindowWindow = this.UIMainWindowWindow; WpfButton uIUpraviťButton = this.UIMainWindowWindow1.UIFramePane.UIUpraviťButton; WpfEdit uICityEdit = this.UIMainWindowWindow1.UICityEdit; WpfButton uIUložiťButton = this.UIMainWindowWindow1.UIUložiťButton; WpfButton uIZatvoriťButton = this.UIMainWindowWindow1.UIZatvoriťButton; #endregion // Click 'MainWindow' title bar Mouse.Click(uIMainWindowTitleBar, new Point(159, 20)); // Click 'Užívatelia' button Mouse.Click(uIUžívateliaButton, new Point(96, 13)); // Click 'Vyskocany' label Mouse.Click(uIVyskocanyText, new Point(34, 14)); // Click 'Upraviť' button Mouse.Click(uIUpraviťButton, new Point(29, 28)); // Type 'Brrrr' in 'City' text box uICityEdit.Text = this.EditUserParams.UICityEditText; // Click 'Uložiť' button Mouse.Click(uIUložiťButton, new Point(77, 17)); // Click 'Zatvoriť' button Mouse.Click(uIZatvoriťButton, new Point(82, 17)); }
/// <summary> /// CreateTestCatalog - Use 'CreateTestCatalogParams' to pass parameters into this method. /// </summary> public void CreateTestCatalog() { #region Variable Declarations WpfTabList uIMainRegionTabList1 = this.UIWpfWindow.UIMainRegionTabList1; WpfEdit uIItemEdit = this.UIWpfWindow.UIVirtoCommerceManagemPane.UICatalogidText.UIItemEdit; WpfEdit uIItemEdit1 = this.UIWpfWindow.UIVirtoCommerceManagemPane.UICatalognameText.UIItemEdit; WpfComboBox uIItemComboBox = this.UIWpfWindow.UIVirtoCommerceManagemPane.UIDefaultlanguageText.UIItemComboBox; WpfButton uIFinishButton = this.UIWpfWindow.UIFinishButton; #endregion // Click 'MainRegion' tab list Mouse.Click(uIMainRegionTabList1, new Point(1768, 152)); // Type 'TestCatalog' in first text box next to '* Catalog id:' label uIItemEdit.Text = this.CreateTestCatalogParams.UIItemEditText; // Type 'Test catalog' in first text box next to '* Catalog name:' label uIItemEdit1.Text = this.CreateTestCatalogParams.UIItemEditText1; // Last action on list item was not recorded because the control does not have any good identification property. // Last action on list item was not recorded because the control does not have any good identification property. // Click first combo box next to '* Default language:' label Mouse.Click(uIItemComboBox, new Point(384, 14)); // Last action on list item was not recorded because the control does not have any good identification property. // Click 'Finish' button Mouse.Click(uIFinishButton, new Point(50, 15)); }
/// <summary> /// Open menu for today and create one /// </summary> public void CreateMenu() { #region Variable Declarations WpfButton uIJedálnylístokButton = this.UIMainWindowWindow1.UIJedálnylístokButton; WpfButton uIPridaťButton = this.UIMainWindowWindow1.UIFramePane.UIPridaťButton; WpfComboBox uIDesertsComboComboBox = this.UIMainWindowWindow1.UIDesertsComboComboBox; WpfComboBox uISoupsComboComboBox = this.UIMainWindowWindow1.UISoupsComboComboBox; WpfEdit uIPriceEdit = this.UIMainWindowWindow1.UIPriceEdit; WpfButton uIUložiťButton = this.UIMainWindowWindow1.UIUložiťButton; WpfButton uIZatvoriťButton = this.UIMainWindowWindow1.UIZatvoriťButton; #endregion // Click 'Jedálny lístok' button Mouse.Click(uIJedálnylístokButton, new Point(111, 7)); // Click 'Pridať' button Mouse.Click(uIPridaťButton, new Point(32, 25)); // Select 'Zmrzlina: Čučoriedková' in 'desertsCombo' combo box uIDesertsComboComboBox.SelectedItem = this.CreateMenuParams.UIDesertsComboComboBoxSelectedItem; // Select 'Brokolicová: Zelena' in 'soupsCombo' combo box uISoupsComboComboBox.SelectedItem = this.CreateMenuParams.UISoupsComboComboBoxSelectedItem; // Type '5' in 'price' text box uIPriceEdit.Text = this.CreateMenuParams.UIPriceEditText; // Click 'Uložiť' button Mouse.Click(uIUložiťButton, new Point(54, 7)); // Click 'Zatvoriť' button Mouse.Click(uIZatvoriťButton, new Point(92, 12)); }
/// <summary> /// AddOrder_2 - Use 'AddOrder_2Params' to pass parameters into this method. /// </summary> public void AddOrder_2() { #region Variable Declarations WpfComboBox uIComboBox_frameSizeComboBox = this.UIBuildaBikeWindow.UIComboBox_frameSizeComboBox; WpfComboBox uIComboBox_frameColourComboBox = this.UIBuildaBikeWindow.UIComboBox_frameColourComboBox; WpfComboBox uIComboBox_gearsBreaksComboBox = this.UIBuildaBikeWindow.UIComboBox_gearsBreaksComboBox; WpfComboBox uIComboBox_wheelsComboBox = this.UIBuildaBikeWindow.UIComboBox_wheelsComboBox; WpfComboBox uIComboBox_handlebarSaComboBox = this.UIBuildaBikeWindow.UIComboBox_handlebarSaComboBox; WpfButton uIAddButton = this.UIBuildaBikeWindow.UIAddButton; #endregion // Select 'Small' in 'comboBox_frameSize' combo box uIComboBox_frameSizeComboBox.SelectedItem = this.AddOrder_2Params.UIComboBox_frameSizeComboBoxSelectedItem; // Select 'Blue' in 'comboBox_frameColour' combo box uIComboBox_frameColourComboBox.SelectedItem = this.AddOrder_2Params.UIComboBox_frameColourComboBoxSelectedItem; // Select 'Group Set 2 (SRAM, Avid)' in 'comboBox_gearsBreaks' combo box uIComboBox_gearsBreaksComboBox.SelectedItem = this.AddOrder_2Params.UIComboBox_gearsBreaksComboBoxSelectedItem; // Select 'Campagnolo' in 'comboBox_wheels' combo box uIComboBox_wheelsComboBox.SelectedItem = this.AddOrder_2Params.UIComboBox_wheelsComboBoxSelectedItem; // Select 'Group Set 2 (Race Face, Fizik Arione)' in 'comboBox_handlebarSaddle' combo box uIComboBox_handlebarSaComboBox.SelectedItem = this.AddOrder_2Params.UIComboBox_handlebarSaComboBoxSelectedItem; // Click 'Add' button Mouse.Click(uIAddButton, new Point(50, 9)); }
public static void CloseDA() { // Click 'Close' button WpfButton closeButton = DesktopAppControls.GetDesktopAppCloseButtonX(); Mouse.Click(closeButton, new Point(35, 21)); }
/// <summary> /// 500*2 /// </summary> public void MethodToMultiply() { #region Variable Declarations WpfButton uIItem5Button = this.UIMyCalculatorv1Window.UIItem5Button; WpfButton uIItem0Button = this.UIMyCalculatorv1Window.UIItem0Button; WpfButton uIItemButton = this.UIMyCalculatorv1Window.UIItemButton; WpfButton uIItem2Button = this.UIMyCalculatorv1Window.UIItem2Button; WpfButton uIItemButton1 = this.UIMyCalculatorv1Window.UIItemButton1; #endregion // Click '5' button Mouse.Click(uIItem5Button, new Point(24, 12)); // Double-Click '0' button Mouse.DoubleClick(uIItem0Button, new Point(35, 12)); // Click '*' button Mouse.Click(uIItemButton, new Point(27, 16)); // Click '2' button Mouse.Click(uIItem2Button, new Point(27, 19)); // Click '=' button Mouse.Click(uIItemButton1, new Point(41, 12)); }
/// <summary> /// TravTestRecordedMethod - Use 'TravTestRecordedMethodParams' to pass parameters into this method. /// </summary> private void TravTestRecordedMethod() { #region Variable Declarations WpfTabPage uIHelpTabPage = this.UIBusinessDesignStudioWindow.UIRibbonTabList.UIHelpTabPage; WpfTreeItem uIUI_SourceServer_BUGSTreeItem = this.UIBusinessDesignStudioWindow.UISourceNavigationViewCustom.UITvExplorerTree.UIDev2StudioViewModelsTreeItem.UIUI_SourceServer_WORKTreeItem.UIUI_SourceServer_BUGSTreeItem; WpfCheckBox uIUI_CheckBoxBUGS_AutoCheckBox = this.UIBusinessDesignStudioWindow.UISourceNavigationViewCustom.UITvExplorerTree.UIDev2StudioViewModelsTreeItem.UIUI_SourceServer_WORKTreeItem.UIUI_SourceServer_BUGSTreeItem.UIUI_CheckBoxBUGS_AutoCheckBox; WpfComboBox uIUI_DestinationServerComboBox = this.UIBusinessDesignStudioWindow.UIDeployResourcesCustom.UIDeployUserControlCustom.UIUI_DestinationServerComboBox; WpfButton uIDeployButton = this.UIBusinessDesignStudioWindow.UIDeployResourcesCustom.UIDeployUserControlCustom.UIDeployButton; #endregion // Click 'Help' tab Mouse.Click(uIHelpTabPage, new Point(304, 64)); // Expand 'Dev2.Studio.ViewModels.Navigation.EnvironmentTreeV...' -> 'UI_SourceServer_WORKFLOWS_AutoID' -> 'UI_SourceServer_BUGS_AutoID' tree item uIUI_SourceServer_BUGSTreeItem.Expanded = this.TravTestRecordedMethodParams.UIUI_SourceServer_BUGSTreeItemExpanded; // Select 'UI_CheckBoxBUGS_AutoID' check box uIUI_CheckBoxBUGS_AutoCheckBox.Checked = this.TravTestRecordedMethodParams.UIUI_CheckBoxBUGS_AutoCheckBoxChecked; // Select 'Dev2.Studio.Core.InterfaceImplementors.ServerDTO' in 'UI_DestinationServercbx_AutoID' combo box uIUI_DestinationServerComboBox.SelectedItem = this.TravTestRecordedMethodParams.UIUI_DestinationServerComboBoxSelectedItem; // Click 'Deploy' button Mouse.Click(uIDeployButton, new Point(25, 17)); }
/// <summary> /// CheckAddition - Use 'CheckAdditionParams' to pass parameters into this method. /// </summary> public void CheckAddition() { #region Variable Declarations WpfEdit uITextBoxEdit = this.UIMainWindowWindow.UITextBoxEdit; WpfEdit uITextBox_CopyEdit = this.UIMainWindowWindow.UITextBox_CopyEdit; WpfComboBox uIComboBoxComboBox = this.UIMainWindowWindow.UIComboBoxComboBox; WpfEdit uITextBox_Copy1Edit = this.UIMainWindowWindow.UITextBox_Copy1Edit; WpfButton uICalculateButton = this.UIMainWindowWindow.UICalculateButton; #endregion // Type '2' in 'textBox' text box uITextBoxEdit.Text = this.CheckAdditionParams.UITextBoxEditText; // Type '{Tab}' in 'textBox' text box Keyboard.SendKeys(uITextBoxEdit, this.CheckAdditionParams.UITextBoxEditSendKeys, ModifierKeys.None); // Type '1' in 'textBox_Copy' text box uITextBox_CopyEdit.Text = this.CheckAdditionParams.UITextBox_CopyEditText; // Type '{Tab}' in 'textBox_Copy' text box Keyboard.SendKeys(uITextBox_CopyEdit, this.CheckAdditionParams.UITextBox_CopyEditSendKeys, ModifierKeys.None); // Select 'Add' in 'comboBox' combo box uIComboBoxComboBox.SelectedItem = this.CheckAdditionParams.UIComboBoxComboBoxSelectedItem; // Click 'textBox_Copy1' text box Mouse.Click(uITextBox_Copy1Edit, new Point(101, 17)); // Click 'Calculate' button Mouse.Click(uICalculateButton, new Point(72, 17)); }
/// <summary> /// RecordedMethod2 - Use 'RecordedMethod2Params' to pass parameters into this method. /// </summary> public void RecordedMethod2() { #region Variable Declarations WinEdit uINameEdit = this.UIDebugWindow.UIItemWindow.UIDigital_docs_wpfListItem.UINameEdit; WpfEdit uILoginBoxEdit = this.UILoginViewWindow.UILoginBoxEdit; WpfEdit uIPasswordBoxEdit = this.UILoginViewWindow.UIPasswordBoxEdit; WpfButton uISigninButton = this.UILoginViewWindow.UISigninButton; WpfButton uIBacktologinButton = this.UIUser1_NewTasksWindow.UIBacktologinButton; WinButton uICloseButton = this.UILoginViewWindow1.UICloseButton; #endregion // Double-Click 'Name' text box Mouse.DoubleClick(uINameEdit, new Point(82, 23)); // Type 'user1' in 'LoginBox' text box uILoginBoxEdit.Text = this.RecordedMethod2Params.UILoginBoxEditText; // Type '{Tab}' in 'LoginBox' text box Keyboard.SendKeys(uILoginBoxEdit, this.RecordedMethod2Params.UILoginBoxEditSendKeys, ModifierKeys.None); // Type '********' in 'PasswordBox' text box Keyboard.SendKeys(uIPasswordBoxEdit, this.RecordedMethod2Params.UIPasswordBoxEditSendKeys, true); // Click 'Sign in' button Mouse.Click(uISigninButton, new Point(35, 8)); // Click 'Back to login' button Mouse.Click(uIBacktologinButton, new Point(59, 51)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(38, 23)); }
public void FeedbackWindow_ClickCancel() { Playback.Wait(500); WpfButton theButton = FeedbackWindow_CancelButton(); Mouse.Click(theButton, new Point(5, 5)); }
/// <summary> /// AddItem - このメソッドにパラメーターを渡すには 'AddItemParams' を使用します。 /// </summary> public void AddItem() { #region Variable Declarations WpfButton uIHomeButton = this.UIMVVMSampleWindow.UIRibbonTabList.UIHOMETabPage.UINavigateGroup.UISystemWindowsControlListItem.UIHomeButton; WpfButton uIProductsButton = this.UIMVVMSampleWindow.UIRibbonTabList.UIHOMETabPage.UINavigateGroup.UISystemWindowsControlListItem1.UIProductsButton; WpfButton uINewItemButton = this.UIMVVMSampleWindow.UIRibbonTabList.UIHOMETabPage.UIEditGroup.UISystemWindowsControlListItem.UINewItemButton; WpfEdit uITitleEdit = this.UIMVVMSampleWindow.UIMainFramePane.UITitleEdit; WpfEdit uIProductUrlEdit = this.UIMVVMSampleWindow.UIMainFramePane.UIProductUrlEdit; WpfButton uISaveButton = this.UIMVVMSampleWindow.UIMainFramePane.UISaveButton; #endregion // クリック 'Home' ボタン Mouse.Click(uIHomeButton, new Point(51, 21)); // クリック 'Products' ボタン Mouse.Click(uIProductsButton, new Point(49, 6)); // クリック 'New Item' ボタン Mouse.Click(uINewItemButton, new Point(40, 13)); // 'Title' テキスト ボックス に 'TEST ITEM' を入力 uITitleEdit.Text = this.AddItemParams.UITitleEditText; // クリック 'ProductUrl' テキスト ボックス Mouse.Click(uIProductUrlEdit, new Point(56, 6)); // クリック 'Save' ボタン Mouse.Click(uISaveButton, new Point(55, 19)); }
/// <summary> /// AddOrder_1 - Use 'AddOrder_1Params' to pass parameters into this method. /// </summary> public void AddOrder_1() { #region Variable Declarations WpfComboBox uIComboBox_frameSizeComboBox = this.UIBuildaBikeWindow.UIComboBox_frameSizeComboBox; WpfComboBox uIComboBox_frameColourComboBox = this.UIBuildaBikeWindow.UIComboBox_frameColourComboBox; WpfComboBox uIComboBox_gearsBreaksComboBox = this.UIBuildaBikeWindow.UIComboBox_gearsBreaksComboBox; WpfComboBox uIComboBox_wheelsComboBox = this.UIBuildaBikeWindow.UIComboBox_wheelsComboBox; WpfComboBox uIComboBox_handlebarSaComboBox = this.UIBuildaBikeWindow.UIComboBox_handlebarSaComboBox; WpfCheckBox uIExtendwarrantyCheckBox = this.UIBuildaBikeWindow.UIExtendwarrantyCheckBox; WpfButton uIAddButton = this.UIBuildaBikeWindow.UIAddButton; #endregion // Select 'Extra Small' in 'comboBox_frameSize' combo box uIComboBox_frameSizeComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_frameSizeComboBoxSelectedItem; // Select 'Red' in 'comboBox_frameColour' combo box uIComboBox_frameColourComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_frameColourComboBoxSelectedItem; // Select 'Group Set 1 (Shimano, Shimano)' in 'comboBox_gearsBreaks' combo box uIComboBox_gearsBreaksComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_gearsBreaksComboBoxSelectedItem; // Select 'Shimano' in 'comboBox_wheels' combo box uIComboBox_wheelsComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_wheelsComboBoxSelectedItem; // Select 'Group Set 1 (Renthal FatBar, Prologo)' in 'comboBox_handlebarSaddle' combo box uIComboBox_handlebarSaComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_handlebarSaComboBoxSelectedItem; // Select 'Extend warranty' check box uIExtendwarrantyCheckBox.Checked = this.AddOrder_1Params.UIExtendwarrantyCheckBoxChecked; // Click 'Add' button Mouse.Click(uIAddButton, new Point(50, 17)); }
public static WpfButton 点击按钮(WpfButton btn) { Logger.LogLine("点击按钮:" + btn.Name); btn.单击(); return(btn); }
public void DeleteTask(int id) { var listItem = getListItem(id); var t = new WpfButton(listItem); string auto_id = "Task_" + id + "-Delete"; t.SearchProperties[WpfButton.PropertyNames.AutomationId] = auto_id; t.WindowTitles.Add("ToDoList"); Mouse.Click(t); }
private WpfButton GetQuickVariableInputButton(UITestControl theTab, string controlAutomationId) { UITestControl aControl = FindControlByAutomationId(theTab, controlAutomationId); WpfButton controlButtons = new WpfButton(aControl); UITestControlCollection buttonCollection = controlButtons.FindMatchingControls(); foreach(WpfButton theButton in buttonCollection) { if (theButton.AutomationId.Contains("QuickVariableAddBtn_AutoID")) { return theButton; } } throw new Exception("Error - The Quick Variable Input button could not be located!"); }
public WpfButton Get_Button(string AutomationId) { var btn = new WpfButton(Get_Window()); btn.SearchProperties[WpfButton.PropertyNames.AutomationId] = AutomationId; return btn; }
private WpfButton FeedbackWindow_OpenDefaultEmailButton() { var feedbackWindow = GetFeedbackWindow(); var children = feedbackWindow.GetChildren(); foreach(var child in children) { if(child.GetProperty("AutomationId").ToString() == "FeebackView_Send") { return child as WpfButton; } } WpfButton theButton = new WpfButton(feedbackWindow); theButton.SearchProperties[WpfButton.PropertyNames.AutomationId] = "FeebackView_Send"; theButton.Find(); return theButton; }
public void SelectedIndex_Copy() { var window = new WpfWindow(); window.SearchProperties[WpfWindow.PropertyNames.Name] = "C1FlexGrid Automation Test"; var btn_SelectedIndex = new WpfButton(window); btn_SelectedIndex.SearchProperties[WpfButton.PropertyNames.AutomationId] = "btn_SelectedIndex"; var btn_Copy = new WpfButton(window); btn_Copy.SearchProperties[WpfButton.PropertyNames.AutomationId] = "btn_Copy"; var flexgrid = new WpfTable(window); flexgrid.SearchProperties[WpfTable.PropertyNames.AutomationId] = "flexgrid"; Mouse.Click(btn_SelectedIndex); Mouse.Click(btn_Copy); Assert.AreEqual("10", btn_Copy.DisplayText.Replace(Environment.NewLine,string.Empty)); }
public void ClickCompanyButton() { WpfButton uIButton = new WpfButton(UIControls.GetUIAControl("CompanyButton", "Button", new UIAXCWindow())); Mouse.Click(uIButton, new Point(uIButton.Width / 2, uIButton.Height / 2)); }
public void ConnectToLowis(bool CreateNewStore) { WpfWindow LOWISConnect = new WpfWindow(); LOWISConnect.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); LOWISConnect.SearchProperties.Add(WpfWindow.PropertyNames.Name, "LOWIS: Connect"); LOWISConnect.WindowTitles.Add("LOWIS: Connect"); WpfComboBox HostCB = new WpfComboBox(LOWISConnect); HostCB.WindowTitles.Add("LOWIS: Connect"); WpfEdit HostTB = new WpfEdit(HostCB); HostTB.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); HostTB.SearchProperties.Add(WpfEdit.PropertyNames.AutomationId, "PART_EditableTextBox"); HostTB.Text = ConnectClientTo; Trace.WriteLine("Set ServerName to " + ConnectClientTo); WpfRadioButton Credentials = new WpfRadioButton(LOWISConnect); Credentials.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); Credentials.SearchProperties.Add(WpfRadioButton.PropertyNames.Name, "Use my windows credentials."); Credentials.WindowTitles.Add("LOWIS: Connect"); Credentials.Selected = true; Trace.WriteLine("Use Windows Credentials checkbox is set to true"); WpfButton ConnectButton = new WpfButton(LOWISConnect); ConnectButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); ConnectButton.SearchProperties[WpfButton.PropertyNames.AccessKey] = "\r"; ConnectButton.WindowTitles.Add("LOWIS: Connect"); WpfButton SettingsButton = new WpfButton(LOWISConnect); SettingsButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); SettingsButton.WindowTitles.Add("LOWIS: Connect"); WpfWindow SettingsWin = new WpfWindow(); SettingsWin.SearchProperties[WpfWindow.PropertyNames.Name] = "LOWIS: Settings"; SettingsWin.SearchProperties.Add(new PropertyExpression(WpfWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains)); SettingsWin.WindowTitles.Add("LOWIS: Settings"); WpfEdit CsStore = new WpfEdit(SettingsWin); CsStore.WindowTitles.Add("LOWIS: Settings"); WpfButton SaveButton = new WpfButton(SettingsWin); SaveButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); SaveButton.SearchProperties[WpfButton.PropertyNames.AccessKey] = "\r"; SaveButton.WindowTitles.Add("LOWIS: Settings"); if (CreateNewStore == true) { Mouse.Click(SettingsButton); Trace.WriteLine("Clicked Settings button on client Logon"); CsStore.Text = "C:\\csstore18"; Trace.WriteLine("Set CsStore path"); Mouse.Click(SaveButton); Trace.WriteLine("Clicked Save Button on settings window"); } Mouse.Click(ConnectButton); Trace.WriteLine("Clicked LOWIS connect button"); }
public static WpfButton 点击按钮(WpfButton btn) { Logger.LogLine("点击按钮:" + btn.Name); btn.单击(); return btn; }