/// <summary> /// RecordedMethod3 - Use 'RecordedMethod3Params' to pass parameters into this method. /// </summary> public void RecordedMethod3() { #region Variable Declarations WpfEdit uITbxFilterEdit = this.UIMainWindowWindow.UIItemCustom.UITbxFilterEdit; WpfList uILstItemsList = this.UIMainWindowWindow.UIItemCustom.UILstItemsList; #endregion // Type 'infection' in 'tbxFilter' text box uITbxFilterEdit.Text = this.RecordedMethod3Params.UITbxFilterEditText; // 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. // 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. // 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. // Right-Click 'lstItems' list box Mouse.Click(uILstItemsList, MouseButtons.Right, ModifierKeys.None, new Point(234, 169)); // Right-Click 'lstItems' list box Mouse.Click(uILstItemsList, MouseButtons.Right, ModifierKeys.None, new Point(235, 169)); }
/// <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> /// 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)); }
/// <summary> /// RecordedMethod2 - Use 'RecordedMethod2Params' to pass parameters into this method. /// </summary> public void RecordedMethod2() { #region Variable Declarations WpfWindow uIWpfWindow = this.UIWpfWindow; WpfEdit uITextBoxEdit = this.UIMainWindowWindow.UITextBoxEdit; #endregion // Click 'Wpf' window Mouse.Click(uIWpfWindow, new Point(488, 91)); // Type 'Hallo Welt' in 'textBox' text box uITextBoxEdit.Text = this.RecordedMethod2Params.UITextBoxEditText; // Click 'Wpf' window Mouse.Click(uIWpfWindow, new Point(118, 111)); // Click 'Wpf' window Mouse.Click(uIWpfWindow, new Point(520, 94)); // Type '{Enter}' in 'textBox' text box Keyboard.SendKeys(uITextBoxEdit, this.RecordedMethod2Params.UITextBoxEditSendKeys, ModifierKeys.None); // Click 'Wpf' window Mouse.Click(uIWpfWindow, new Point(145, 111)); // Type 'asdfsdf' in 'textBox' text box uITextBoxEdit.Text = this.RecordedMethod2Params.UITextBoxEditText1; // Click 'Wpf' window Mouse.Click(uIWpfWindow, new Point(136, 92)); }
/// <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> /// Tells you if a WpfEdit is on read only mode. /// </summary> /// <param name="control">The target wpf edit automation element.</param> /// <returns>True if the wpfEdit is readOnly, False otherwise.</returns> /// <exception cref="ArgumentNullException">richText</exception> /// <exception cref="InvalidOperationException">Cannot retrieve the info from the control</exception> public static bool IsReadOnly(this WpfEdit richText) { if (richText == null) { throw new ArgumentNullException("richText"); } AutomationElement element = WpfControlExtensions.GetAutomationElement(richText); richText.SetFocus(); var pattern = element.GetCurrentPattern(TextPattern.Pattern) as TextPattern; if (pattern == null) { throw new InvalidOperationException("Cannot retrieve the info from the control"); } //pattern.DocumentRange.Select(); TextPatternRange[] selection = pattern.GetSelection(); if (selection.Any()) { object attValue = selection[0].GetAttributeValue(TextPattern.IsReadOnlyAttribute); if (attValue == null) { throw new InvalidOperationException("Cannot retrieve the info from the control"); } //pattern.DocumentRange.RemoveFromSelection(); return(bool.Parse(attValue.ToString())); } throw new InvalidOperationException("Cannot retrieve the info from the control"); }
/// <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> /// 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)); }
public void ClickItem(int row) { WpfRow theRow = GetRow(row); WpfEdit requiredEdit = (WpfEdit)theRow.GetChildren()[2].GetChildren()[0]; Mouse.Click(requiredEdit, new Point(5, 5)); }
/// <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> /// 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 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> /// 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)); }
/// <summary> /// /// </summary> /// <param name="window"></param> /// <param name="automationId"></param> /// <returns></returns> public static WpfEdit GetEditByAutomationId(this WinWindow window, string automationId) { WpfEdit btn = new WpfEdit(window); btn.SearchProperties[WpfEdit.PropertyNames.AutomationId] = automationId; return(btn); }
/// <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)); }
public void LargeViewTextboxesEnterTestData(ToolType tool, UITestControl theTab) { //Find the start point UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); // Drag the tool onto the workflow ToolboxUIMap.DragControlToWorkflowDesigner(tool, workflowPoint1); WorkflowDesignerUIMap.OpenCloseLargeView(tool, theTab); // Add the data! List <UITestControl> listOfTextboxes = GetAllTextBoxesFromLargeView(tool.ToString(), theTab); int counter = 0; foreach (var textbox in listOfTextboxes) { WpfEdit tb = textbox as WpfEdit; if (tb != null && !tb.IsPassword) { tb.SetFocus(); SendKeys.SendWait("[[theVar" + counter.ToString(CultureInfo.InvariantCulture) + "]]"); } counter++; } }
/// <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)); }
/// <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)); }
public void EnterTextInDestinationServerFilterBox(UITestControl theTab, string text) { WpfEdit theBox = GetDestinationServerFilterBox(theTab); Mouse.Click(new Point(theBox.BoundingRectangle.X + 15, theBox.BoundingRectangle.Y + 15)); SendKeys.SendWait(text); }
public void EnterTextIntoRow(int rowIndex, string stringToEnter) { WpfRow wpfRow = GetRow(rowIndex); WpfEdit requiredEdit = (WpfEdit)wpfRow.GetChildren()[2].GetChildren()[0]; requiredEdit.EnterText(stringToEnter); }
public void EnterTextInSourceServerFilterBox(UITestControl theTab, string text) { WpfEdit theBox = GetSourceServerFilterBox(theTab); Mouse.Click(new Point(theBox.BoundingRectangle.X + 15, theBox.BoundingRectangle.Y + 15)); SendKeys.SendWait(text); Playback.Wait(1500); }
/// <summary> /// VerifyResult - Use 'VerifyResultExpectedValues' to pass parameters into this method. /// </summary> public void VerifyResult() { #region Variable Declarations WpfEdit uIResultingNumberEdit = this.UISimpleCalculatorWindow.UIResultingNumberEdit; #endregion // Verify that the 'Text' property of 'ResultingNumber' text box equals '3' Assert.AreEqual(this.VerifyResultExpectedValues.UIResultingNumberEditText, uIResultingNumberEdit.Text, "Result is wrong!"); }
/// <summary> /// CheckValue - Use 'CheckValueExpectedValues' to pass parameters into this method. /// </summary> public void CheckValue() { #region Variable Declarations WpfEdit uITextBox_Copy1Edit = this.UIMainWindowWindow.UITextBox_Copy1Edit; #endregion // Verify that the 'ControlType' property of 'textBox_Copy1' text box equals '3' Assert.AreEqual(this.CheckValueExpectedValues.UITextBox_Copy1EditControlType, uITextBox_Copy1Edit.ControlType.ToString(), "Error in addition"); }
/// <summary> /// AssertMultiplication - Use 'AssertMultiplicationExpectedValues' to pass parameters into this method. /// </summary> public void AssertMultiplication() { #region Variable Declarations WpfEdit uITBEdit = this.UIMyCalculatorv1Window.UITBEdit; #endregion // Verify that the 'Text' property of 'tb' text box contains '500*2=1000' StringAssert.Contains(uITBEdit.Text, this.AssertMultiplicationExpectedValues.UITBEditText, "There is no Operation in the output field"); }
public string GetSalesTaxPayableValue() { WinEdit uIItem = new WinEdit(UIControls.GetControl("Description", "Edit", new UIAXCWindow())); Mouse.Click(uIItem, new Point(uIItem.Width / 2, uIItem.Height / 2)); Keyboard.SendKeys("{TAB}"); WpfEdit uIAItem = new WpfEdit(UIControls.GetUIAControl("SegmentTextBox0", "Edit", new UIAXCWindow())); return uIAItem.Text; }
/// <summary> /// Enterfirstnumberintotheleftfield - Test Case 1 - Use 'EnterfirstnumberintotheleftfieldParams' to pass parameters into this method. /// </summary> public void Enterfirstnumberintotheleftfield() { #region Variable Declarations WpfEdit uIInputNumber1Edit = this.UISimpleCalculatorWindow.UIInputNumber1Edit; #endregion // Type '1' in 'InputNumber1' text box uIInputNumber1Edit.Text = this.EnterfirstnumberintotheleftfieldParams.UIInputNumber1EditText; }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WpfEdit uITxtWordEdit = this.UIDictionaryENWindow.UITxtWordEdit; #endregion // Type 'wer' in 'txtWord' text box uITxtWordEdit.Text = this.RecordedMethod1Params.UITxtWordEditText; }
/// <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 static WpfEdit GetPasswordFieldEdit() { if (_passwordFieldEdit == null) { _passwordFieldEdit = new WpfEdit(GetItemCustom()); _passwordFieldEdit.SearchProperties[WpfEdit.PropertyNames.AutomationId] = "PasswordField"; } return(_passwordFieldEdit); }
/// <summary> /// Entersecondnumberintotherightfield - Test Case 1 - Use 'EntersecondnumberintotherightfieldParams' to pass parameters into this method. /// </summary> public void Entersecondnumberintotherightfield() { #region Variable Declarations WpfEdit uIInputNumber2Edit = this.UISimpleCalculatorWindow.UIInputNumber2Edit; #endregion // Type '2' in 'InputNumber2' text box uIInputNumber2Edit.Text = this.EntersecondnumberintotherightfieldParams.UIInputNumber2EditText; }
public void ThenIDontNameTheCreatedFolder() { WpfEdit newFolderEdit = this.SaveDialogWindow.ExplorerView.ExplorerTree.localhost.FirstItem.UIItemEdit; WpfButton saveButton = this.SaveDialogWindow.SaveButton; Keyboard.SendKeys(newFolderEdit, "{Right}{Enter}", ModifierKeys.None); // Click 'Save' button Mouse.Click(saveButton, new Point(22, 16)); }
public string GetTaskMessage(int id) { //WpfEdit uiTask1DescriptionEdit = UIToDoListWindow.TaskList.TaskItemListItem.UITask_1DescriptionEdit; string seekedAutomationId = "Task_" + id + "-Description"; var listItem = getListItem(id); var t = new WpfEdit(listItem); t.SearchProperties[WpfEdit.PropertyNames.AutomationId] = seekedAutomationId; t.WindowTitles.Add("ToDoList"); return t.Text; }
public string GetSalesTaxReceivableValue() { WinEdit uIItem = new WinEdit(UIControls.GetControl("Description", "Edit", new UIAXCWindow())); Mouse.Click(uIItem, new Point(uIItem.Width / 2, uIItem.Height / 2)); Keyboard.SendKeys("{TAB}"); Keyboard.SendKeys("{TAB}"); WpfText uIAText = new WpfText(UIControls.GetUIAControl("StatusTextBlock", "Text", new UIAXCWindow())); if (uIAText.DisplayText == "Account number for sales tax receivable") { var window = AutomationElement.RootElement.FindFirst(TreeScope.Descendants, new System.Windows.Automation.PropertyCondition(AutomationElement.NameProperty, "Ledger posting groups", PropertyConditionFlags.IgnoreCase)); WpfEdit uIAItem = new WpfEdit(UIControls.GetUIAControl("SegmentTextBox0", "Edit", new UIAXCWindow())); return uIAItem.Text; } else { throw new Exception("Incorrect field selected"); } }
public void Filter() { var msg = "Default:" + Get_Grid().RowCount; var body = new WpfPane(Get_Grid()); body.SearchProperties[WpfPane.PropertyNames.AutomationId] = "Body"; var cell = new WpfCustom(body); cell.SearchProperties[WpfCustom.PropertyNames.ClassName] = "Uia.DataGridCellPresenter"; var filterbox = new WpfEdit(cell); filterbox.Text = "Closed"; msg += ".AfterFilter:" + Get_Grid().RowCount; Assert.AreEqual("Default:12.AfterFilter:7", msg); }
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 void SetUIAControlValue(string name, string type, string value, WinWindow parent) { WpfControl uIControl = new WpfControl(parent); uIControl.TechnologyName = "UIA"; uIControl.SearchProperties.Add("ControlType", type); uIControl.SearchProperties.Add("AutomationId", name); uIControl.WaitForControlReady(); if (type == "CheckBox") { WpfCheckBox mUICheckBox = new WpfCheckBox(uIControl); mUICheckBox.Checked = Convert.ToBoolean(value); } else if (type == "Edit") { WpfEdit mUIEdit = new WpfEdit(uIControl); mUIEdit.Text = value; } }
public static void SetUIAItemControlValue(string name, string type, string value, WinWindow parent) { WinWindow itemWindow = new WinWindow(parent); itemWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains)); itemWindow.WaitForControlReady(); WpfPane pane = new WpfPane(itemWindow); WpfCustom customControl = new WpfCustom(pane); customControl.SearchProperties[WpfControl.PropertyNames.ClassName] = "Uia.SegmentedEntry"; customControl.WaitForControlReady(); WpfControl uIControl = new WpfControl(customControl); uIControl.TechnologyName = "UIA"; uIControl.SearchProperties.Add("ControlType", type); uIControl.SearchProperties.Add("AutomationId", name); uIControl.WaitForControlReady(); if (type == "CheckBox") { WpfCheckBox mUICheckBox = new WpfCheckBox(uIControl); mUICheckBox.Checked = Convert.ToBoolean(value); } else if (type == "Edit") { WpfEdit mUIEdit = new WpfEdit(uIControl); mUIEdit.Text = value; } }