Exemple #1
0
        public void I_Enter_Invalid_Service_Name_Into_SaveDialog(string ServiceName)
        {
            WpfText errorLabel = SaveDialogWindow.ErrorLabel;

            SaveDialogWindow.ServiceNameTextBox.Text = ServiceName;
            Assert.AreEqual("'Name' contains invalid characters", errorLabel.DisplayText, "Error is not the same as expected");
        }
        /// <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));
        }
        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);
        }
Exemple #4
0
        public void Enter_Service_Name_Into_Duplicate_Dialog(string ServiceName)
        {
            WpfText errorLabel = SaveDialogWindow.ErrorLabel;

            SaveDialogWindow.ServiceNameTextBox.Text = ServiceName;
            Assert.IsTrue(SaveDialogWindow.DuplicateButton.Enabled, "Save dialog save button is not enabled. Check workflow name is valid and that another workflow by that name does not already exist.");
        }
Exemple #5
0
        public void Enter_Service_Name_Into_Save_Dialog_and_Append_Unique_Guid(string ServiceName)
        {
            WpfText errorLabel = SaveDialogWindow.ErrorLabel;

            SaveDialogWindow.ServiceNameTextBox.Text = ServiceName + Guid.NewGuid().ToString().Substring(0, 8);
            Assert.IsTrue(SaveDialogWindow.SaveButton.Enabled, "Save dialog save button is not enabled. Check workflow name is valid and that another workflow by that name does not already exist.");
        }
Exemple #6
0
        public void Enter_Service_Name_Into_Save_Dialog(string ServiceName, bool duplicate = false, bool invalid = false, bool nameHasWhiteSpace = false, SaveOrDuplicate saveOrDuplicate = SaveOrDuplicate.Save)
        {
            WpfText errorLabel = SaveDialogWindow.ErrorLabel;

            SaveDialogWindow.ServiceNameTextBox.Text = ServiceName;
            Assert.IsTrue(SaveDialogWindow.SaveButton.Enabled, "Save dialog save button is not enabled. Check workflow name is valid and that another workflow by that name does not already exist.");
        }
Exemple #7
0
        /// <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));
        }
Exemple #8
0
        public string GetInputMappingToServiceValue(int rowNumber)
        {
            var rows = GetInputMappingRows();

            if (rows.Count >= rowNumber)
            {
                UITestControlCollection rowChildren    = rows[rowNumber - 1].GetChildren();
                List <UITestControl>    cells          = rowChildren.Where(c => c.ControlType == ControlType.Cell).ToList();
                UITestControlCollection cellChildren   = cells[1].GetChildren();
                UITestControl           firstOrDefault = cellChildren.FirstOrDefault(c => c.ControlType == ControlType.Text && c.FriendlyName != "*");
                if (firstOrDefault != null)
                {
                    WpfText wpfText = firstOrDefault as WpfText;
                    if (wpfText != null)
                    {
                        return(wpfText.DisplayText);
                    }
                }
            }
            else
            {
                throw new Exception("The row could not be found.");
            }
            return(null);
        }
Exemple #9
0
        public void Enter_Invalid_Service_Name_Into_Duplicate_Dialog(string ServiceName)
        {
            WpfText errorLabel = SaveDialogWindow.ErrorLabel;

            SaveDialogWindow.ServiceNameTextBox.Text = ServiceName;
            Assert.AreEqual("'Name' contains leading or trailing whitespace characters.", errorLabel.DisplayText, "Error is not the same as expected");
            Assert.IsFalse(SaveDialogWindow.DuplicateButton.Enabled, "Save dialog save button is not enabled. Check workflow name is valid and that another workflow by that name does not already exist.");
        }
        public static WpfText TextInTable(string txt)
        {
            var newTxt = new WpfText(UsersTable);

            newTxt.SearchProperties[UITestControl.PropertyNames.ClassName] = "Uia.TextBlock";
            newTxt.SearchProperties[UITestControl.PropertyNames.Name]      = txt;
            return(newTxt);
        }
Exemple #11
0
        public WpfApp(DesktopContext context)
            : base(context)
        {
            this.SearchProperties.Add(WpfControl.PropertyNames.Name, "MainWindow");

            this.ClickButton = this.CreateControl <WpfButton>("ClicksBtn");
            this.ClickLabel  = this.CreateControl <WpfText>("ClicksLbl");
        }
Exemple #12
0
        /// <summary>
        /// ClickToolboxLabel
        /// </summary>
        public void ClickToolboxLabel()
        {
            #region Variable Declarations
            WpfText uIToolboxText = this.UIWarewolfWindow.UIZf1166e575b5d43bb89fCustom.UIToolboxCustom.UIToolboxText;
            #endregion

            // Click 'Toolbox' label
            Mouse.Click(uIToolboxText, new Point(32, 10));
        }
Exemple #13
0
        /// <summary>
        /// p1Score1 - Use 'p1Score1ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void p1Score1()
        {
            #region Variable Declarations
            WpfText uIScore1Text = this.UIBoggleWindow.UIScore1Text;
            #endregion

            // Verify that the 'AutomationId' property of 'score1' label equals '0'
            Assert.AreEqual(this.p1Score1ExpectedValues.UIScore1TextAutomationId, uIScore1Text.AutomationId, "FAIL");
        }
Exemple #14
0
        /// <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));
        }
        /// <summary>
        /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertMethod1()
        {
            #region Variable Declarations
            WpfText uIHallowiegehtsText = this.UIMainWindowWindow.UIHallowiegehtsText;
            #endregion

            // Verify that the 'DisplayText' property of 'Hallo wie gehts?' label equals 'Hallo wie gehts?'
            Assert.AreEqual(this.AssertMethod1ExpectedValues.UIHallowiegehtsTextDisplayText, uIHallowiegehtsText.DisplayText);
        }
Exemple #16
0
        /// <summary>
        /// Assert_Success - Verwenden Sie "Assert_SuccessExpectedValues", um Parameter an diese Methode zu übergeben.
        /// </summary>
        public void Assert_Success()
        {
            #region Variable Declarations
            WpfText uITodowurdeerfolgreichText1 = this.UITodosWindow.UIItemCustom.UIBeschreibungdarfnichText.UITodowurdeerfolgreichText1;
            #endregion

            // Sicherstellen, dass die Eigenschaft 'ControlType' von "Todo wurde erfolgreich gespeichert" Bezeichnung ist gleich 'Text'
            Assert.AreEqual(this.Assert_SuccessExpectedValues.UITodowurdeerfolgreichText1ControlType, uITodowurdeerfolgreichText1.ControlType.ToString(), "Todo wurde erfolgreich gespeichert");
        }
Exemple #17
0
        /// <summary>
        /// Assert_Fail - Verwenden Sie "Assert_FailExpectedValues", um Parameter an diese Methode zu übergeben.
        /// </summary>
        public void Assert_Fail()
        {
            #region Variable Declarations
            WpfText uIBeschreibungdarfnichText1 = this.UITodosWindow.UIItemCustom.UIBeschreibungdarfnichText.UIBeschreibungdarfnichText1;
            #endregion

            // Sicherstellen, dass die Eigenschaft 'Name' von "Beschreibung darf nicht leer sein!" Bezeichnung ist gleich 'Beschreibung darf nicht leer sein!'
            Assert.AreEqual(this.Assert_FailExpectedValues.UIBeschreibungdarfnichText1Name, uIBeschreibungdarfnichText1.Name, "Create_Todo_Fail Failed");
        }
Exemple #18
0
        /// <summary>
        /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertMethod1()
        {
            #region Variable Declarations
            WpfText uITbResultText = this.UIMainWindowWindow.UITbResultText;
            #endregion

            // Verify that the 'DisplayText' property of 'tbResult' label equals 'Prateek 10101'
            Assert.AreEqual(mRecordedMethod1Params.UITbNameEditText + " " + mRecordedMethod1Params.UITbIdEditText, uITbResultText.DisplayText);
        }
Exemple #19
0
        /// <summary>
        /// AssertValidErrMsg - Use 'AssertValidErrMsgExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertValidErrMsg()
        {
            #region Variable Declarations
            WpfText errorMsg = this.UILoginWindow.ErrorMsgContainer.ErrorMsg;
            #endregion

            // Verify that the 'DisplayText' property of 'The username and password combination was invalid' label equals 'The username and password combination was invalid'
            Assert.AreEqual(this.AssertValidErrMsgExpectedValues.ErrorMsgDisplayText, errorMsg.DisplayText, "Unexpected Error Message");
        }
        /// <summary>
        /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertMethod1()
        {
            #region Variable Declarations
            WpfText uIV103122018153239SaveText1 = this.MergeDialogWindow.MergeResourceVersionList.WarewolfStudioViewMoListItem.ItemRadioButton.UIV103122018153239SaveText.UIV103122018153239SaveText1;
            #endregion

            // Verify that the 'ControlType' property of 'v.1 03122018 153239 Save' label equals 'Text'
            Assert.AreEqual(this.AssertMethod1ExpectedValues.UIV103122018153239SaveText1ControlType, uIV103122018153239SaveText1.ControlType.ToString());
        }
Exemple #21
0
        /// <summary>
        /// ClickSwitch
        /// </summary>
        public void ClickSwitch()
        {
            #region Variable Declarations
            WpfText uISwitchText1 = this.UIWarewolfWindow.UIItemCustom.UIPART_ToolsTree.UIControlFlowTreeItem.UISystemActivitiesStatTreeItem.UISwitchText.UISwitchText1;
            #endregion

            // Click 'Switch' label
            Mouse.Click(uISwitchText1, new Point(10, 8));
        }
        /// <summary>
        /// NumberTextBoxClick
        /// </summary>
        public void NumberTextBoxClick()
        {
            #region Variable Declarations
            WpfText uIWholeordecimalText = this.UIBusinessDesignStudioWindow.UIDsfNumberFormatActivCustom.UIUI__Number_Inputtxt_Edit.UIWholeordecimalText;
            #endregion

            // Click 'Whole or decimal' label
            Mouse.Click(uIWholeordecimalText, new Point(60, 8));
        }
Exemple #23
0
        /// <summary>
        /// ClickExplorerLabel
        /// </summary>
        public void ClickExplorerLabel()
        {
            #region Variable Declarations
            WpfText uIExplorerText = this.UIWarewolfWindow.UIZf1166e575b5d43bb89fCustom.UIZ3d0e8544bdbd4fbc8b0TabList.UIExplorerTabPage.UIExplorerCustom.UIExplorerText;
            #endregion

            // Click 'Explorer' label
            Mouse.Click(uIExplorerText, new Point(37, 6));
        }
Exemple #24
0
        /// <summary>
        /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertMethod1()
        {
            #region Variable Declarations
            WpfText uITypehelptogetstartedText1 = this.UICInteractiveWindowWindow.UITypehelptogetstartedText.UITypehelptogetstartedText1;
            #endregion

            // Verify that the 'ControlType' property of 'Type 'help' to get started :)' label equals 'Text'
            Assert.AreEqual(this.AssertMethod1ExpectedValues.UITypehelptogetstartedText1ControlType, uITypehelptogetstartedText1.ControlType.ToString(), "Type 'help' to get started :)");
        }
Exemple #25
0
        public void TestRecursiveDependencies()
        {
            #region Variable Declarations
            WpfText uIRecursiveDependencyTText = this.UIBusinessDesignStudioWindow.UIItemCustom.UIMyScrollViewerPane.UIRecursiveDependencyTText;
            #endregion

            // Verify that the 'AutomationId' property of 'RecursiveDependencyTest' label equals '[DependencyGraph_RecursiveDependencyTest_IsCircular_True]'
            Assert.AreEqual("[DependencyGraph_RecursiveDependencyTest_IsCircular_True]", uIRecursiveDependencyTText.AutomationId);
        }
        private WpfText GetTitleLabel(string autoId)
        {
            UITestControlCollection uiTestControlCollection = StudioWindow.GetChildren();
            var tryGetDialog = uiTestControlCollection[0];

            UITestControl childByAutomationIDPath = VisualTreeWalker.GetChildByAutomationIdPath(tryGetDialog, autoId);
            WpfText       wpfText = childByAutomationIDPath as WpfText;

            if (wpfText != null)
            {
                return(wpfText);
            }
            throw new Exception("Could not find the " + autoId + " label.");
        }
Exemple #27
0
        public string GetHelpText()
        {
            UITestControl        parentControl           = Activity.GetParent();
            List <UITestControl> uiTestControlCollection = parentControl.GetChildren().Where(c => c.ControlType == ControlType.Text).ToList();

            try
            {
                WpfText lbl = (WpfText)uiTestControlCollection[1];
                return(lbl.DisplayText);
            }
            catch (Exception)
            {
                throw new Exception("The Help text couldn't be found, probably because of the activity not expanding on drop.");
            }
        }
Exemple #28
0
        /// <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));
        }
Exemple #29
0
        /// <summary>
        /// CreateNewProject
        /// </summary>
        public void CreateNewProject()
        {
            #region Variable Declarations
            WpfMenuItem uIProjectMenuItem          = this.UIStartPageMicrosoftViWindow.UIMenuBarMenuBar.UIFileMenuItem.UINewMenuItem.UIProjectMenuItem;
            WpfText     uIUwpTemplatesbasedAppText = this.UINewProjectWindow.UIM_vsExtnsExplorerCtlCustom.UIExtensionsTable.UIUwpTemplatesbasedAppDataItem.UIItemCell.UIUwpTemplatesbasedAppText;
            WpfButton   uIOKButton = this.UINewProjectWindow.UIOKButton;
            #endregion

            // Click 'File' -> 'New' -> 'Project...' menu item
            Mouse.Click(uIProjectMenuItem, new Point(48, 9));

            // Click 'Uwp Templates based App (vs2017 dev-nightly)' label
            Mouse.Click(uIUwpTemplatesbasedAppText, new Point(70, 1));

            // Click 'OK' button
            Mouse.Click(uIOKButton, new Point(34, 10));
        }
        /// <summary>
        /// Negativtest - Verwenden Sie "NegativtestParams", um Parameter an diese Methode zu übergeben.
        /// </summary>
        public void Negativtest()
        {
            #region Variable Declarations
            WinEdit       uINameEdit                  = this.UIDebugWindow.UIItemWindow.UILb120_2_BibliothekexListItem.UINameEdit;
            WpfButton     uIBücherButton              = this.UIMainWindowWindow.UIBücherButton;
            WpfText       uIAforbeginnersText         = this.UIMainWindowWindow.UIItemCustom2.UIDataGridTable.UIItem166Row.UIAforbeginnersCell.UIAforbeginnersText;
            WpfDatePicker uIDtpStartDatePicker        = this.UIMainWindowWindow.UIScrollViewerPane.UIDtpStartDatePicker;
            WpfDatePicker uIDtpEndDatePicker          = this.UIMainWindowWindow.UIScrollViewerPane.UIDtpEndDatePicker;
            WpfComboBox   uICbxKundeComboBox          = this.UIMainWindowWindow.UIScrollViewerPane.UICbxKundeComboBox;
            WpfButton     uISpeichernButton           = this.UIMainWindowWindow.UIScrollViewerPane.UISpeichernButton;
            WpfText       uIDatumüberschneidetsiText1 = this.UIMainWindowWindow.UIItemCustom1.UIGespeichertText.UIDatumüberschneidetsiText1;
            WpfButton     uIZurückButton              = this.UIMainWindowWindow.UIScrollViewerPane.UIZurückButton;
            WinButton     uISchließenButton           = this.UIMainWindowWindow1.UISchließenButton;
            #endregion

            // Doppelklicken "Name" Textfeld
            Mouse.DoubleClick(uINameEdit, new Point(234, 10));

            // Klicken "Bücher" Schaltfläche
            Mouse.Click(uIBücherButton, new Point(78, 12));

            // Doppelklicken "A# for beginners" Bezeichnung
            Mouse.DoubleClick(uIAforbeginnersText, new Point(82, 10));

            // "06-Jun-2018" in "dtpStart" Datumsauswahl auswählen
            uIDtpStartDatePicker.DateAsString = this.NegativtestParams.UIDtpStartDatePickerDateAsString;

            // "01-Dec-2018" in "dtpEnd" Datumsauswahl auswählen
            uIDtpEndDatePicker.DateAsString = this.NegativtestParams.UIDtpEndDatePickerDateAsString;

            // "111" in "cbxKunde" Kombinationsfeld auswählen
            uICbxKundeComboBox.SelectedItem = this.NegativtestParams.UICbxKundeComboBoxSelectedItem;

            // Klicken "Speichern" Schaltfläche
            Mouse.Click(uISpeichernButton, new Point(44, 11));

            // Klicken "Datum überschneidet sich mit einer anderen Ausleih..." Bezeichnung
            Mouse.Click(uIDatumüberschneidetsiText1, new Point(81, 11));

            // Klicken "Zurück" Schaltfläche
            Mouse.Click(uIZurückButton, new Point(49, 13));

            // Klicken "Schließen" Schaltfläche
            Mouse.Click(uISchließenButton, new Point(23, 20));
        }
        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");
            }
        }