/// <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)); }
/// <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 WpfTable_GetRowAndCellByAutomationId_CanGetCellValue() { WpfRow row0 = mainWindow.dg1.Get <WpfRow>("AutomationId=Row0"); WpfCell row0cell0 = row0.Get <WpfCell>("AutomationId=cellRow0Col0"); Assert.AreEqual("XML in Action", row0cell0.Value); }
/// <summary> /// Positivtest 1 /// </summary> public void alfons_antener() { #region Variable Declarations WpfListItem uISystemDynamicExpandoListItem = this.UIMainWindowWindow.UILb_vermietungList.UISystemDynamicExpandoListItem; WpfButton uINeuButton = this.UIMainWindowWindow.UIItemCustom.UINeuButton; WpfButton uIItemButton = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIElement0AnzeigeindexCell.UIItemButton; WpfText uIAntenerText = this.UIMainWindowWindow.UIUc_selectKundenCustom.UIDg_listeTable.UIItem1Row.UIAntenerCell.UIAntenerText; WpfButton uISpeichernButton = this.UIMainWindowWindow.UIUc_selectKundenCustom.UISpeichernButton; WpfButton uIItemButton1 = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIElement0AnzeigeindexCell1.UIItemButton; WpfText uIScottText = this.UIMainWindowWindow.UIUc_selectFahrradCustom.UIDg_listeTable.UIItem1Row.UIScottCell.UIScottText; WpfButton uISpeichernButton1 = this.UIMainWindowWindow.UIUc_selectFahrradCustom.UISpeichernButton; WpfCell uIItem110001120000AMCell = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell; WpfEdit uIItemEdit = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell.UIItemEdit; WpfCell uIItem110001120000AMCell1 = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell1; WpfEdit uIItemEdit1 = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell1.UIItemEdit; WpfButton uISpeichernButton2 = this.UIMainWindowWindow.UIItemCustom.UISpeichernButton; #endregion // Klicken "System.Dynamic.ExpandoObject" Listenelement Mouse.Click(uISystemDynamicExpandoListItem, new Point(311, 5)); // Klicken "Neu" Schaltfläche Mouse.Click(uINeuButton, new Point(263, 11)); // Klicken Schaltfläche Mouse.Click(uIItemButton, new Point(27, 4)); // Klicken "Antener" Bezeichnung Mouse.Click(uIAntenerText, new Point(31, 10)); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton, new Point(119, 14)); // Klicken Schaltfläche Mouse.Click(uIItemButton1, new Point(25, 12)); // Klicken "Scott" Bezeichnung Mouse.Click(uIScottText, new Point(65, 8)); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton1, new Point(182, 21)); // "5/6/2017 8:00:00 AM" in "1/1/0001 12:00:00 AM" Zelle eingeben uIItem110001120000AMCell.Value = this.alfons_antenerParams.UIItem110001120000AMCellValue; // '{Tab}' in Textfeld eingeben Keyboard.SendKeys(uIItemEdit, this.alfons_antenerParams.UIItemEditSendKeys, ModifierKeys.None); // "5/6/2017 4:00:00 PM" in "1/1/0001 12:00:00 AM" Zelle eingeben uIItem110001120000AMCell1.Value = this.alfons_antenerParams.UIItem110001120000AMCell1Value; // '{Enter}' in Textfeld eingeben Keyboard.SendKeys(uIItemEdit1, this.alfons_antenerParams.UIItemEditSendKeys1, ModifierKeys.None); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton2, new Point(279, 7)); }
public void WpfListView_GetRow_CanClickOnCell() { WpfTable listView = mainWindow.Get <WpfTable>("AutomationId=lv1"); Assert.AreEqual(8, listView.RowCount); WpfControl <CUITControls.WpfControl> control = listView.Get <WpfControl <CUITControls.WpfControl> >("AutomationId=Item0"); WpfCell cell = control.Get <WpfCell>("ColumnHeader=Content"); cell.Click(); }
/// <summary> /// AddNewItem1 - Use 'AddNewItem1Params' to pass parameters into this method. /// </summary> public void AddNewItem1() { #region Variable Declarations WinTitleBar uIMainWindowTitleBar = this.UIMainWindowWindow.UIMainWindowTitleBar; WpfText uIHOMEText = this.UIMainWindowWindow1.UIMainFramePane.UIHOMEText; WpfTable uIMainListTable = this.UIMainWindowWindow1.UIMainFramePane.UIMainListTable; WpfButton uIAddButton = this.UIMainWindowWindow1.UIMainFramePane.UIAddButton; WpfText uIADDNEWITEMText = this.UIMainWindowWindow1.UIMainFramePane.UIADDNEWITEMText; WpfEdit uINameEdit = this.UIMainWindowWindow1.UIMainFramePane.UINameEdit; WpfEdit uIDescriptionEdit = this.UIMainWindowWindow1.UIMainFramePane.UIDescriptionEdit; WpfButton uIOKButton = this.UIMainWindowWindow1.UIMainFramePane.UIOKButton; WpfCell uINewItem1Cell = this.UIMainWindowWindow1.UIMainFramePane.UIMainListTable.UIItemDataItem.UINewItem1Cell; #endregion // 最後のマウス操作が記録されませんでした。 // Click 'MainWindow' title bar Mouse.Click(uIMainWindowTitleBar, new Point(148, 7)); // Click 'HOME' label Mouse.Click(uIHOMEText, new Point(46, 24)); // Click 'mainList' table Mouse.Click(uIMainListTable, new Point(226, 168)); // Click 'Add' button Mouse.Click(uIAddButton, new Point(15, 6)); // Click 'ADD NEW ITEM' label Mouse.Click(uIADDNEWITEMText, new Point(99, 17)); // Type 'New Item 1' in 'name' text box uINameEdit.Text = this.AddNewItem1Params.UINameEditText; // Type 'TEST1' in 'Description' text box uIDescriptionEdit.Text = this.AddNewItem1Params.UIDescriptionEditText; // Click 'OK' button Mouse.Click(uIOKButton, new Point(11, 22)); // Click 'HOME' label Mouse.Click(uIHOMEText, new Point(55, 13)); // Click 'New Item 1' cell Mouse.Click(uINewItem1Cell, new Point(42, 6)); }
public bool FlagExists(int index) { var mailsTable = MailsTableUIMap.UIMarktelerikdomaincomWindow.UIItemCustom.UILoadingProgressBar.UIGridViewTable; var virtualizingPanel = mailsTable.GetChildren().Single(item => (item as WpfControl).AutomationId == "PART_GridViewVirtualizingPanel"); WpfRow row = new WpfRow(virtualizingPanel); row.SearchProperties[WpfControl.PropertyNames.AutomationId] = "Row_" + index; row.Find(); WpfCell cell = new WpfCell(row); cell.SearchProperties[WpfControl.PropertyNames.AutomationId] = "Cell_" + index + "_3"; cell.Find(); WpfCustom cellElement = new WpfCustom(cell); cellElement.SearchProperties[WpfControl.PropertyNames.AutomationId] = "CellElement_" + index + "_3"; return cellElement.TryFind(); }
/// <summary> /// TestToggleCommand - Use 'TestToggleCommandParams' to pass parameters into this method. /// </summary> public void TestToggleCommand() { #region Variable Declarations WinEdit uINameEdit = this.UIDebugWindow.UIItemWindow.UIDIWPFOneexeListItem.UINameEdit; WinPane uIItem1TestAutomationwPane = this.UIItem1TestAutomationwWindow.UIItem1TestAutomationwWindow1.UIItem1TestAutomationwPane; WpfToggleButton uIToggleViewModelToggleButton = this.UIDIWPFOneWindow.UIUserControlToggleCustom.UIToggleViewModelToggleButton; WpfCell uIEnglandCell = this.UIDIWPFOneWindow.UIItemTable.UIItemDataItem.UIEnglandCell; #endregion // Double-Click 'Name' text box Mouse.DoubleClick(uINameEdit, new Point(71, 11)); // Click '(1) Test Automation with Microsoft Visual Studio 2...' pane Mouse.Click(uIItem1TestAutomationwPane, new Point(465, 862)); // Set to 'Pressed' state 'Toggle ViewModel' toggle button uIToggleViewModelToggleButton.Pressed = this.TestToggleCommandParams.UIToggleViewModelToggleButtonPressed; // Click 'England' cell Mouse.Click(uIEnglandCell, new Point(11, 5)); // Set to 'Normal' state 'Toggle ViewModel' toggle button uIToggleViewModelToggleButton.Pressed = this.TestToggleCommandParams.UIToggleViewModelToggleButtonPressed1; }
/// <summary> /// RecordedMethod2 - Use 'RecordedMethod2Params' to pass parameters into this method. /// </summary> public void RecordedMethod2() { #region Variable Declarations WpfList uINamesList = this.UIExpenseItWindow.UINamesList; WpfButton uIViewButton = this.UIExpenseItWindow.UIViewButton; WpfCell uIDocumentprintingCell = this.UIExpenseItWindow.UIExpensereportTable.UIDataGridRowRow.UIDocumentprintingCell; WpfEdit uIItemEdit = this.UIExpenseItWindow.UIExpensereportTable.UIDataGridRowRow.UIDocumentprintingCell.UIItemEdit; #endregion // Launch 'C:\workspace\WalkthroughFirstWPFApp\csharp\bin\Debug\netcoreapp3.1\ExpenseIt9.exe' ApplicationUnderTest uIExpenseItWindow = ApplicationUnderTest.Launch(this.RecordedMethod2Params.UIExpenseItWindowExePath, this.RecordedMethod2Params.UIExpenseItWindowAlternateExePath); // Select 'Lisa' in 'Names' list box uINamesList.SelectedItemsAsString = this.RecordedMethod2Params.UINamesListSelectedItemsAsString; // Click 'View' button Mouse.Click(uIViewButton, new Point(54, 18)); // Type 'printing' in 'Document printing' cell uIDocumentprintingCell.Value = this.RecordedMethod2Params.UIDocumentprintingCellValue; // Type '{Back}{Enter}' in text box Keyboard.SendKeys(uIItemEdit, this.RecordedMethod2Params.UIItemEditSendKeys, ModifierKeys.None); }
public static void FileTransfer_Upload_Files() { ConnectToHost(); GeneralUtilities.FileTransferUtil.OpenFileTransfer(); WpfCustom appBarCustom = GeneralUtilities.FileTransferControls.GetAppBarCustom(); Mouse.Click(appBarCustom, new Point(481, 28)); Thread.Sleep(1000); // root folder that cannot have files uploaded WpfButton okButton = new WpfButton(GeneralUtilities.FileTransferControls.GetFileTransferWindow()); okButton.SearchProperties[WpfButton.PropertyNames.AutomationId] = "OkButton"; Thread.Sleep(1000); Mouse.Click(okButton, new Point(30, 19)); // move to other folders, 1st level folder WpfCustom folderListCustom1 = new WpfCustom(GeneralUtilities.FileTransferControls.GetFileTransferWindow()); folderListCustom1.SearchProperties[WpfControl.PropertyNames.ClassName] = "Uia.FolderListControl"; folderListCustom1.SearchProperties[WpfControl.PropertyNames.AutomationId] = "FolderList"; WpfTable fullListTable = new WpfTable(folderListCustom1); fullListTable.SearchProperties[WpfTable.PropertyNames.AutomationId] = "FullList"; WpfControl itemDataItem1 = new WpfControl(fullListTable); itemDataItem1.SearchProperties[WpfControl.PropertyNames.ControlType] = "DataItem"; itemDataItem1.SearchProperties[WpfControl.PropertyNames.Instance] = "3"; WpfCell itemCell = new WpfCell(itemDataItem1); itemCell.SearchProperties[WpfCell.PropertyNames.ColumnHeader] = "FILE NAME"; Mouse.DoubleClick(itemCell, new Point(37, 18)); Thread.Sleep(2000); // 2nd level folder, **** need to clean the old controls (the way CodedUI/SC do) and start new ones as following GeneralUtilities.FileTransferControls.ClearFileTransferControls(); WpfCustom folderListCustom2 = new WpfCustom(GeneralUtilities.FileTransferControls.GetFileTransferWindow()); folderListCustom2.SearchProperties[WpfControl.PropertyNames.ClassName] = "Uia.FolderListControl"; folderListCustom2.SearchProperties[WpfControl.PropertyNames.AutomationId] = "FolderList"; WpfTable fullListTable2 = new WpfTable(folderListCustom2); fullListTable2.SearchProperties[WpfTable.PropertyNames.AutomationId] = "FullList"; WpfControl itemDataItem2 = new WpfControl(fullListTable2); itemDataItem2.SearchProperties[WpfControl.PropertyNames.ControlType] = "DataItem"; WpfCell itemCell2 = new WpfCell(itemDataItem2); itemCell2.SearchProperties[WpfCell.PropertyNames.ColumnHeader] = "FILE NAME"; Mouse.DoubleClick(itemCell2, new Point(59, 15)); Thread.Sleep(2000); // click Upload button appBarCustom = GeneralUtilities.FileTransferControls.GetAppBarCustom(); Mouse.Click(appBarCustom, new Point(481, 28)); Thread.Sleep(1000); // make sure "Select File" window is up WinWindow selectFilesWindow = GeneralUtilities.FileTransferControls.GetSelectFileWindow(); Thread.Sleep(1000); Assert.IsTrue(selectFilesWindow.Exists, "Select File Window does not show up!"); // Select a file WinEdit nameEdit = GeneralUtilities.FileTransferControls.GetSelectFileNameEdit(); Mouse.Click(nameEdit, new Point(123, 15)); // Open/load the file WinButton openButton = GeneralUtilities.FileTransferControls.GetSelectFileOpenButton(); Mouse.Click(openButton, new Point(24, 9)); Thread.Sleep(3000); // xxxx make sure the file is there, may use FT window move arounf directories then come back to verify it WpfButton homeButton = new WpfButton(GeneralUtilities.FileTransferControls.GetFileTransferWindow()); homeButton.SearchProperties[WpfButton.PropertyNames.Name] = "Home"; Mouse.Click(homeButton, new Point(14, 9)); Thread.Sleep(2000); GeneralUtilities.FileTransferUtil.CloseFileTransfer(); Thread.Sleep(1000); // Clean up the files under the upload directory // launch command window on host and run batch Keyboard.SendKeys("R", System.Windows.Input.ModifierKeys.Windows); Thread.Sleep(1000); Keyboard.SendKeys("cmd"); Thread.Sleep(1000); Keyboard.SendKeys("{ENTER}"); Thread.Sleep(1000); Keyboard.SendKeys("cd C:\\ShareConnect"); Keyboard.SendKeys("{ENTER}"); Thread.Sleep(1000); Keyboard.SendKeys("DeleteFiles.bat"); Keyboard.SendKeys("{ENTER}"); Thread.Sleep(1000); Keyboard.SendKeys("exit"); Keyboard.SendKeys("{ENTER}"); DisconnectFromHost(); }
public void CodedUITestMethod1Original() { using (var app = App.LaunchSolutionProject(this, "SampleWpfApp")) { // UIMap.cs からコピーして使用して実装しました。 // using を追加し、this を UIMap に変更します。 #region Variable Declarations WinTitleBar uIMainWindowTitleBar = UIMap.UIMainWindowWindow.UIMainWindowTitleBar; WpfText uIHOMEText = UIMap.UIMainWindowWindow1.UIMainFramePane.UIHOMEText; WpfTable uIMainListTable = UIMap.UIMainWindowWindow1.UIMainFramePane.UIMainListTable; WpfButton uIAddButton = UIMap.UIMainWindowWindow1.UIMainFramePane.UIAddButton; WpfText uIADDNEWITEMText = UIMap.UIMainWindowWindow1.UIMainFramePane.UIADDNEWITEMText; WpfEdit uINameEdit = UIMap.UIMainWindowWindow1.UIMainFramePane.UINameEdit; WpfEdit uIDescriptionEdit = UIMap.UIMainWindowWindow1.UIMainFramePane.UIDescriptionEdit; WpfButton uIOKButton = UIMap.UIMainWindowWindow1.UIMainFramePane.UIOKButton; WpfCell uINewItem1Cell = UIMap.UIMainWindowWindow1.UIMainFramePane.UIMainListTable.UIItemDataItem.UINewItem1Cell; #endregion // 最初に検証を追加しました。 System.Threading.Thread.Sleep(TimeSpan.FromSeconds(0.5)); Assert.AreEqual("HOME", uIHOMEText.Name, "0.5秒以内に、ホーム画面に遷移したこと"); // ※ CodedUITestPlus を使って以下のようにも書けます。 //OperationAssert.TextIs( // "最初に 0.5 秒以内にホーム画面が表示されること", // "HOME", // app.Element.Sleep( TimeSpan.FromSeconds( 0.5 ) ).Find( "(pageTitle)" ).MoveMouseTo() ); // ※録画時にクリックしなかった要素(UIMap にマッピングされなかった要素)は、CodedUITestPlus で独自にクエリします。 Assert.AreEqual(0, uIMainListTable.RowCount, "最初にリストアイテムが表示されていないこと"); Console.WriteLine("Click 'MainWindow' title bar"); Mouse.Click(uIMainWindowTitleBar, new Point(148, 7)); Console.WriteLine("Click 'HOME' label"); Mouse.Click(uIHOMEText, new Point(46, 24)); Console.WriteLine("Click 'mainList' table"); Mouse.Click(uIMainListTable, new Point(226, 168)); Console.WriteLine("Click 'Add' button"); Mouse.Click(uIAddButton, new Point(15, 6)); // UIMap に記録された Mouse.Click( uIADDNEWITEMText, new Point( 99, 17 ) ); を検証に変更しました。 System.Threading.Thread.Sleep(TimeSpan.FromSeconds(0.5)); Assert.AreEqual("ADD NEW ITEM", uIADDNEWITEMText.Name, "0.5秒以内に、編集画面に遷移したこと"); Console.WriteLine("Type 'New Item 1' in 'name' text box"); uINameEdit.Text = UIMap.AddNewItem1Params.UINameEditText; Console.WriteLine("Type 'TEST1' in 'Description' text box"); uIDescriptionEdit.Text = UIMap.AddNewItem1ParamsCustomized.UIDescriptionEditText; Console.WriteLine("Click 'OK' button"); Mouse.Click(uIOKButton, new Point(11, 22)); // UIMap に記録された Mouse.Click( uIHOMEText, new Point( 55, 13 ) ); を検証に変更しました。 System.Threading.Thread.Sleep(TimeSpan.FromSeconds(0.5)); Assert.AreEqual("HOME", uIHOMEText.Name, "0.5秒以内に、ホーム画面に遷移したこと"); Console.WriteLine("Click 'New Item 1' cell"); Mouse.Click(uINewItem1Cell, new Point(42, 6)); Assert.AreEqual(1, uIMainListTable.RowCount, "リストアイテムが1つ追加されて表示されていること"); } // end using } // end function
/// <summary> /// Alfons Antener /// </summary> public void positivtest1() { #region Variable Declarations WpfListItem uISystemDynamicExpandoListItem = this.UIMainWindowWindow.UILb_vermietungList.UISystemDynamicExpandoListItem; WpfButton uINeuButton = this.UIMainWindowWindow.UIItemCustom.UINeuButton; WpfCell uIElement0AnzeigeindexCell = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIElement0AnzeigeindexCell; WpfButton uIItemButton = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIElement0AnzeigeindexCell.UIItemButton; WpfText uIAntenerText = this.UIMainWindowWindow.UIUc_selectKundenCustom.UIDg_listeTable.UIItem1Row.UIAntenerCell.UIAntenerText; WpfButton uISpeichernButton = this.UIMainWindowWindow.UIUc_selectKundenCustom.UISpeichernButton; WpfButton uIItemButton1 = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIElement0AnzeigeindexCell1.UIItemButton; WpfText uIMZ10Text = this.UIMainWindowWindow.UIUc_selectFahrradCustom.UIDg_listeTable.UIItem1Row.UIMZ10Cell.UIMZ10Text; WpfButton uISpeichernButton1 = this.UIMainWindowWindow.UIUc_selectFahrradCustom.UISpeichernButton; WpfCell uIItem110001120000AMCell = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell; WpfEdit uIItemEdit = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell.UIItemEdit; WpfCell uIItem110001120000AMCell1 = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell1; WpfEdit uIItemEdit1 = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell1.UIItemEdit; WpfButton uISpeichernButton2 = this.UIMainWindowWindow.UIItemCustom.UISpeichernButton; #endregion // Klicken "System.Dynamic.ExpandoObject" Listenelement Mouse.Click(uISystemDynamicExpandoListItem, new Point(214, 17)); // Klicken "Neu" Schaltfläche Mouse.Click(uINeuButton, new Point(179, 9)); // Klicken "Element: 0, Anzeigeindex der Spalte: 0" Zelle Mouse.Click(uIElement0AnzeigeindexCell, new Point(18, 18)); // Klicken Schaltfläche Mouse.Click(uIItemButton, new Point(20, 11)); // Klicken "Antener" Bezeichnung Mouse.Click(uIAntenerText, new Point(18, 8)); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton, new Point(108, 12)); // Klicken Schaltfläche Mouse.Click(uIItemButton1, new Point(14, 8)); // Klicken "MZ10" Bezeichnung Mouse.Click(uIMZ10Text, new Point(35, 11)); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton1, new Point(221, 16)); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton1, new Point(329, 19)); // "5/6/2017 8:00:00 AM" in "1/1/0001 12:00:00 AM" Zelle eingeben uIItem110001120000AMCell.Value = this.positivtest1Params.UIItem110001120000AMCellValue; // '{Tab}' in Textfeld eingeben Keyboard.SendKeys(uIItemEdit, this.positivtest1Params.UIItemEditSendKeys, ModifierKeys.None); // "5/6/2017 4:00:00 PM" in "1/1/0001 12:00:00 AM" Zelle eingeben uIItem110001120000AMCell1.Value = this.positivtest1Params.UIItem110001120000AMCell1Value; // '{Enter}' in Textfeld eingeben Keyboard.SendKeys(uIItemEdit1, this.positivtest1Params.UIItemEditSendKeys1, ModifierKeys.None); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton2, new Point(239, 12)); }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WinListItem uIExpenseIt9exeShortcuListItem = this.UIProgramManagerWindow.UIDesktopList.UIExpenseIt9exeShortcuListItem; WpfText uIMikeText = this.UIExpenseItWindow.UINamesList.UIMikeListItem.UISystemXmlXmlAttributText.UIMikeText; WpfButton uIViewButton = this.UIExpenseItWindow.UIViewButton; WpfCell uIItem50Cell = this.UIExpenseItWindow.UIExpensereportTable.UIDataGridRowRow.UIItem50Cell; WpfCell uIItem50Cell1 = this.UIExpenseItWindow.UIExpensereportTable.UIDataGridRowRow1.UIItem50Cell; WpfWindow uIExpenseItWindow1 = this.UIExpenseItWindow; WpfEdit uIItemEdit = this.UIExpenseItWindow.UIExpensereportTable.UIDataGridRowRow1.UIItem50Cell.UIItemEdit; WpfButton uIBackButton = this.UIExpenseItWindow.UIBackButton; WpfText uIJohnText = this.UIExpenseItWindow.UINamesList1.UIJohnListItem.UISystemXmlXmlAttributText.UIJohnText; WpfList uINamesList1 = this.UIExpenseItWindow.UINamesList1; WpfButton uIForwardButton = this.UIExpenseItWindow.UIForwardButton; WpfList uINamesList2 = this.UIExpenseItWindow.UINamesList2; WpfButton uIViewButton1 = this.UIExpenseItWindow.UIViewButton1; WpfText uIItem50Text = this.UIExpenseItWindow.UIExpensereportTable1.UIDataGridRowRow.UIItem50Cell.UIItem50Text; #endregion // Click 'ExpenseIt9.exe - Shortcut' list item Mouse.Click(uIExpenseIt9exeShortcuListItem, new Point(28, 30)); // Launch 'C:\workspace\WalkthroughFirstWPFApp\csharp\bin\Debug\netcoreapp3.1\ExpenseIt9.exe' ApplicationUnderTest uIExpenseItWindow = ApplicationUnderTest.Launch(this.RecordedMethod1Params.UIExpenseItWindowExePath, this.RecordedMethod1Params.UIExpenseItWindowAlternateExePath); // Click 'Mike' label Mouse.Click(uIMikeText, new Point(21, 8)); // Click 'View' button Mouse.Click(uIViewButton, new Point(60, 12)); // Type '589' in '50' cell uIItem50Cell.Value = this.RecordedMethod1Params.UIItem50CellValue; // Type '111' in '50' cell uIItem50Cell1.Value = this.RecordedMethod1Params.UIItem50CellValue1; // Click 'ExpenseIt' window Mouse.Click(uIExpenseItWindow1, new Point(396, 260)); // Type '{Enter}' in text box Keyboard.SendKeys(uIItemEdit, this.RecordedMethod1Params.UIItemEditSendKeys, ModifierKeys.None); // Click 'Back' button Mouse.Click(uIBackButton, new Point(11, 14)); // Click 'John' label Mouse.Click(uIJohnText, new Point(15, 9)); // Select 'Lisa' in 'Names' list box uINamesList1.SelectedItemsAsString = this.RecordedMethod1Params.UINamesList1SelectedItemsAsString; // Click 'Forward' button Mouse.Click(uIForwardButton, new Point(9, 10)); // Click 'Back' button Mouse.Click(uIBackButton, new Point(11, 16)); // Select 'Mike' in 'Names' list box uINamesList2.SelectedItemsAsString = this.RecordedMethod1Params.UINamesList2SelectedItemsAsString; // Click 'Forward' button Mouse.Click(uIForwardButton, new Point(15, 11)); // Click 'Back' button Mouse.Click(uIBackButton, new Point(9, 18)); // Click 'View' button Mouse.Click(uIViewButton1, new Point(37, 7)); // Click '50' label Mouse.Click(uIItem50Text, new Point(14, 8)); // Click 'Back' button Mouse.Click(uIBackButton, new Point(15, 11)); // Click 'Forward' button Mouse.Click(uIForwardButton, new Point(7, 12)); // Click 'Back' button Mouse.Click(uIBackButton, new Point(10, 12)); }
/// <summary> /// Positivtest1 - Verwenden Sie "Positivtest1Params", um Parameter an diese Methode zu übergeben. /// </summary> public void Positivtest1() { #region Variable Declarations WinEdit uINameEdit = this.UIDebugWindow.UIItemWindow.UIM120LB2FS17ListItem.UINameEdit; WpfListItem uISystemDynamicExpandoListItem = this.UIMainWindowWindow.UILb_vermietungList.UISystemDynamicExpandoListItem; WpfButton uINeuButton = this.UIMainWindowWindow.UIItemCustom.UINeuButton; WpfButton uIItemButton = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIElement0AnzeigeindexCell.UIItemButton; WpfText uIAntenerText = this.UIMainWindowWindow.UIUc_selectKundenCustom.UIDg_listeTable.UIItem1Row.UIAntenerCell.UIAntenerText; WpfButton uISpeichernButton = this.UIMainWindowWindow.UIUc_selectKundenCustom.UISpeichernButton; WpfButton uIItemButton1 = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIElement0AnzeigeindexCell1.UIItemButton; WpfText uIScottText = this.UIMainWindowWindow.UIUc_selectFahrradCustom.UIDg_listeTable.UIItem1Row.UIScottCell.UIScottText; WpfButton uISpeichernButton1 = this.UIMainWindowWindow.UIUc_selectFahrradCustom.UISpeichernButton; WpfCell uIItem110001120000AMCell = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell; WpfEdit uIItemEdit = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell.UIItemEdit; WpfCell uIItem110001120000AMCell1 = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell1; WpfEdit uIItemEdit1 = this.UIMainWindowWindow.UIItemCustom.UIDg_vermietungTable.UIItem0Row.UIItem110001120000AMCell1.UIItemEdit; WpfButton uISpeichernButton2 = this.UIMainWindowWindow.UIItemCustom.UISpeichernButton; WpfButton uIHauptmenuButton = this.UIMainWindowWindow.UIItemCustom.UIHauptmenuButton; WinButton uISchließenButton = this.UIMainWindowWindow1.UISchließenButton; #endregion // Doppelklicken "Name" Textfeld Mouse.DoubleClick(uINameEdit, new Point(123, 1)); // Klicken "System.Dynamic.ExpandoObject" Listenelement Mouse.Click(uISystemDynamicExpandoListItem, new Point(130, 11)); // Klicken "Neu" Schaltfläche Mouse.Click(uINeuButton, new Point(137, 10)); // Klicken Schaltfläche Mouse.Click(uIItemButton, new Point(27, 12)); // Klicken "Antener" Bezeichnung Mouse.Click(uIAntenerText, new Point(25, 8)); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton, new Point(98, 12)); // Klicken Schaltfläche Mouse.Click(uIItemButton1, new Point(23, 5)); // Klicken "Scott" Bezeichnung Mouse.Click(uIScottText, new Point(44, 10)); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton1, new Point(144, 22)); // "5/6/2017 8:00:00 AM" in "1/1/0001 12:00:00 AM" Zelle eingeben uIItem110001120000AMCell.Value = this.Positivtest1Params.UIItem110001120000AMCellValue; // '{Tab}' in Textfeld eingeben Keyboard.SendKeys(uIItemEdit, this.Positivtest1Params.UIItemEditSendKeys, ModifierKeys.None); // "5/6/2017 4:00:00 PM" in "1/1/0001 12:00:00 AM" Zelle eingeben uIItem110001120000AMCell1.Value = this.Positivtest1Params.UIItem110001120000AMCell1Value; // '{Enter}' in Textfeld eingeben Keyboard.SendKeys(uIItemEdit1, this.Positivtest1Params.UIItemEditSendKeys1, ModifierKeys.None); // Klicken "Speichern" Schaltfläche Mouse.Click(uISpeichernButton2, new Point(272, 15)); // Klicken "Hauptmenu" Schaltfläche Mouse.Click(uIHauptmenuButton, new Point(304, 10)); // Klicken "Schließen" Schaltfläche Mouse.Click(uISchließenButton, new Point(22, 24)); }
public WpfCellControlPageModelWrapper(WpfCell control, Func <string, TValue> stringToValueFunc) : this(control, stringToValueFunc, x => x.Value) { }
public void BasicTest() { // 1. Launch SM /*string AppPath = "C:\\Users\\Creozy\\Documents\\SM\\SM__(20.1)_20.1.46.106674\\Launcher.exe"; * ApplicationUnderTest App = ApplicationUnderTest.Launch(AppPath); * * Playback.Wait(30000);*/ //Main SM Window double i = 0; 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)"); //Check server is created //try //{ try { WpfCell Servercell = new WpfCell(mainWindow); Servercell.WindowTitles.Add("Service Manager20.1 20.1.86.107687 (20.1)"); Servercell.TechnologyName = "MSAA"; Servercell.SearchProperties.Add("ControlType", "Cell"); Servercell.SearchProperties[WpfCell.PropertyNames.Value] = "ygs.t1"; //} Mouse.Click(Servercell); Playback.Wait(3000); } catch (UITestControlNotFoundException) { WpfButton AddNewServer = new WpfButton(mainWindow); AddNewServer.WindowTitles.Add("Service Manager20.1 20.1.86.107687 (20.1)"); AddNewServer.TechnologyName = "MSAA"; AddNewServer.SearchProperties.Add("ControlType", "MenuItem"); AddNewServer.SearchProperties[WpfButton.PropertyNames.Name] = "Add new server"; Mouse.Click(AddNewServer); Playback.Wait(3000); //Server name Window WpfWindow ServerName = new WpfWindow(); ServerName.SearchProperties[WpfWindow.PropertyNames.Name] = "Server name"; ServerName.WindowTitles.Add("Server name"); WpfEdit ServNameEdit = new WpfEdit(ServerName); ServNameEdit.WindowTitles.Add("Server name"); ServNameEdit.TechnologyName = "MSAA"; ServNameEdit.SearchProperties.Add("ControlType", "Edit"); ServNameEdit.SearchProperties[WpfEdit.PropertyNames.Name] = "Server Name"; Keyboard.SendKeys(ServNameEdit, "ygs.t1"); WpfEdit ServUrlEdit = new WpfEdit(ServerName); ServUrlEdit.WindowTitles.Add("Server name"); ServUrlEdit.TechnologyName = "MSAA"; ServUrlEdit.SearchProperties.Add("ControlType", "Edit"); ServUrlEdit.SearchProperties[WpfEdit.PropertyNames.Name] = "http://server.url"; Keyboard.SendKeys(ServUrlEdit, "http://ygs.20.1.t1.connectivegames.com"); WpfEdit AdminLogin = new WpfEdit(ServerName); AdminLogin.WindowTitles.Add("Server name"); AdminLogin.TechnologyName = "MSAA"; AdminLogin.SearchProperties.Add("ControlType", "Edit"); AdminLogin.SearchProperties[WpfEdit.PropertyNames.Name] = "(none)"; Keyboard.SendKeys(AdminLogin, "admin"); WpfEdit AdminPass = new WpfEdit(ServerName); AdminPass.WindowTitles.Add("Server name"); AdminPass.TechnologyName = "MSAA"; AdminPass.SearchProperties.Add("ControlType", "Edit"); AdminPass.SearchProperties[WpfEdit.PropertyNames.Name] = "PasswordTextEdit"; Keyboard.SendKeys(AdminPass, "Admin"); /*WpfCheckBox PassRemember = new WpfCheckBox(ServerName); * PassRemember.WindowTitles.Add("Server name"); * PassRemember.TechnologyName = "MSAA"; * PassRemember.SearchProperties.Add("ControlType", "CheckBox"); * PassRemember.SearchConfigurations[] = "control9"; * * PassRemember.Checked = checked(true); */ WpfButton SaveButton = new WpfButton(ServerName); SaveButton.WindowTitles.Add("Server name"); SaveButton.TechnologyName = "MSAA"; SaveButton.SearchProperties.Add("ControlType", "Button"); SaveButton.SearchProperties[WpfButton.PropertyNames.Name] = "Save"; try { Assert.AreEqual("admin", AdminLogin.GetProperty("Text").ToString(), "Error in admin text"); } catch (AssertFailedException) { Console.WriteLine("Admin text not correct"); i++; } try { Assert.AreEqual("ygs.t1", ServNameEdit.GetProperty("Text").ToString(), "Error in server name text"); } catch (AssertFailedException) { Console.WriteLine("Server text not correct"); i++; } Mouse.Click(SaveButton); } Assert.AreEqual(0, i, 0, i + " Error(s) in test"); // Mouse.Click(SaveButton); }
public WpfCellControlPageModelWrapper(WpfCell control, Func <string, TValue> stringToValueFunc, Func <WpfCell, string> controlToStringFunc) : base(control, stringToValueFunc, controlToStringFunc) { }
public static ITextValuedPageModel <TValue> AsPageModel <TValue>(this WpfCell cell, Func <string, TValue> stringToValueFunc) { return(new WpfCellControlPageModelWrapper <TValue>(cell, stringToValueFunc)); }
public static ITextValuedPageModel <string> AsPageModel(this WpfCell cell) { return(cell.AsPageModel(StandardFunctionProvider.StringReturnSelf)); }
/// <summary> /// AddNewItem1 - Use 'AddNewItem1Params' to pass parameters into this method. /// </summary> public void AddNewItem1Customized() { #region Variable Declarations WinTitleBar uIMainWindowTitleBar = this.UIMainWindowWindow.UIMainWindowTitleBar; WpfText uIHOMEText = this.UIMainWindowWindow1.UIMainFramePane.UIHOMEText; WpfTable uIMainListTable = this.UIMainWindowWindow1.UIMainFramePane.UIMainListTable; WpfButton uIAddButton = this.UIMainWindowWindow1.UIMainFramePane.UIAddButton; WpfText uIADDNEWITEMText = this.UIMainWindowWindow1.UIMainFramePane.UIADDNEWITEMText; WpfEdit uINameEdit = this.UIMainWindowWindow1.UIMainFramePane.UINameEdit; WpfEdit uIDescriptionEdit = this.UIMainWindowWindow1.UIMainFramePane.UIDescriptionEdit; WpfButton uIOKButton = this.UIMainWindowWindow1.UIMainFramePane.UIOKButton; WpfCell uINewItem1Cell = this.UIMainWindowWindow1.UIMainFramePane.UIMainListTable.UIItemDataItem.UINewItem1Cell; #endregion // // UIMap.Designer.cs から UIMap.cs にコードを移すと、UIMap.uitest 画面に表示されなくなります。 // AddNewItem1Customized は説明のために複製して作成したものです。 // // 最後のマウス操作が記録されませんでした。 // 最初に検証を追加しました。 System.Threading.Thread.Sleep(TimeSpan.FromSeconds(0.5)); Assert.AreEqual("HOME", uIHOMEText.Name, "0.5秒以内に、ホーム画面に遷移したこと"); // ※ CodedUITestPlus を使って以下のようにも書けます。 //OperationAssert.TextIs( // "最初に 0.5 秒以内にホーム画面が表示されること", // "HOME", // this.mUIMainWindowWindow.Query().Sleep( TimeSpan.FromSeconds( 0.5 ) ).Find( "(pageTitle)" ) ); // ※録画時にクリックしなかった要素(UIMap にマッピングされなかった要素)は、CodedUITestPlus で独自にクエリします。 Console.WriteLine("Click 'MainWindow' title bar"); Mouse.Click(uIMainWindowTitleBar, new Point(148, 7)); Console.WriteLine("Click 'HOME' label"); Mouse.Click(uIHOMEText, new Point(46, 24)); Console.WriteLine("Click 'mainList' table"); Mouse.Click(uIMainListTable, new Point(226, 168)); Console.WriteLine("Click 'Add' button"); Mouse.Click(uIAddButton, new Point(15, 6)); // UIMap に記録された Mouse.Click( uIADDNEWITEMText, new Point( 99, 17 ) ); を検証に変更しました。 Assert.AreEqual("ADD NEW ITEM", uIADDNEWITEMText.Name, "0.5秒以内に、編集画面に遷移したこと"); Console.WriteLine("Type 'New Item 1' in 'name' text box"); uINameEdit.Text = this.AddNewItem1Params.UINameEditText; Console.WriteLine("Type 'TEST1' in 'Description' text box"); uIDescriptionEdit.Text = this.AddNewItem1ParamsCustomized.UIDescriptionEditText; Console.WriteLine("Click 'OK' button"); Mouse.Click(uIOKButton, new Point(11, 22)); // UIMap に記録された Mouse.Click( uIHOMEText, new Point( 55, 13 ) ); を検証に変更しました。 System.Threading.Thread.Sleep(TimeSpan.FromSeconds(0.5)); Assert.AreEqual("HOME", uIHOMEText.Name, "0.5秒以内に、ホーム画面に遷移したこと"); Console.WriteLine("Click 'New Item 1' cell"); Mouse.Click(uINewItem1Cell, new Point(42, 6)); }