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> /// 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); }
/// <summary> /// AddOrder_1 - Use 'AddOrder_1Params' to pass parameters into this method. /// </summary> public void AddOrder_1() { #region Variable Declarations WpfComboBox uIComboBox_frameSizeComboBox = this.UIBuildaBikeWindow.UIComboBox_frameSizeComboBox; WpfComboBox uIComboBox_frameColourComboBox = this.UIBuildaBikeWindow.UIComboBox_frameColourComboBox; WpfComboBox uIComboBox_gearsBreaksComboBox = this.UIBuildaBikeWindow.UIComboBox_gearsBreaksComboBox; WpfComboBox uIComboBox_wheelsComboBox = this.UIBuildaBikeWindow.UIComboBox_wheelsComboBox; WpfComboBox uIComboBox_handlebarSaComboBox = this.UIBuildaBikeWindow.UIComboBox_handlebarSaComboBox; WpfCheckBox uIExtendwarrantyCheckBox = this.UIBuildaBikeWindow.UIExtendwarrantyCheckBox; WpfButton uIAddButton = this.UIBuildaBikeWindow.UIAddButton; #endregion // Select 'Extra Small' in 'comboBox_frameSize' combo box uIComboBox_frameSizeComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_frameSizeComboBoxSelectedItem; // Select 'Red' in 'comboBox_frameColour' combo box uIComboBox_frameColourComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_frameColourComboBoxSelectedItem; // Select 'Group Set 1 (Shimano, Shimano)' in 'comboBox_gearsBreaks' combo box uIComboBox_gearsBreaksComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_gearsBreaksComboBoxSelectedItem; // Select 'Shimano' in 'comboBox_wheels' combo box uIComboBox_wheelsComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_wheelsComboBoxSelectedItem; // Select 'Group Set 1 (Renthal FatBar, Prologo)' in 'comboBox_handlebarSaddle' combo box uIComboBox_handlebarSaComboBox.SelectedItem = this.AddOrder_1Params.UIComboBox_handlebarSaComboBoxSelectedItem; // Select 'Extend warranty' check box uIExtendwarrantyCheckBox.Checked = this.AddOrder_1Params.UIExtendwarrantyCheckBoxChecked; // Click 'Add' button Mouse.Click(uIAddButton, new Point(50, 17)); }
/// <summary> /// AddOrder_3 - Use 'AddOrder_3Params' to pass parameters into this method. /// </summary> public void AddOrder_3() { #region Variable Declarations WpfComboBox uIComboBox_frameSizeComboBox = this.UIBuildaBikeWindow.UIComboBox_frameSizeComboBox; WpfComboBox uIComboBox_frameColourComboBox = this.UIBuildaBikeWindow.UIComboBox_frameColourComboBox; WpfComboBox uIComboBox_gearsBreaksComboBox = this.UIBuildaBikeWindow.UIComboBox_gearsBreaksComboBox; WpfComboBox uIComboBox_wheelsComboBox = this.UIBuildaBikeWindow.UIComboBox_wheelsComboBox; WpfComboBox uIComboBox_handlebarSaComboBox = this.UIBuildaBikeWindow.UIComboBox_handlebarSaComboBox; WpfCheckBox uIExtendwarrantyCheckBox = this.UIBuildaBikeWindow.UIExtendwarrantyCheckBox; WpfButton uIAddButton = this.UIBuildaBikeWindow.UIAddButton; #endregion // Select 'Large' in 'comboBox_frameSize' combo box uIComboBox_frameSizeComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_frameSizeComboBoxSelectedItem; // Select 'Black' in 'comboBox_frameColour' combo box uIComboBox_frameColourComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_frameColourComboBoxSelectedItem; // Select 'Group Set 3 (Campagnolo, Clarks)' in 'comboBox_gearsBreaks' combo box uIComboBox_gearsBreaksComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_gearsBreaksComboBoxSelectedItem; // Select 'DT Swiss' in 'comboBox_wheels' combo box uIComboBox_wheelsComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_wheelsComboBoxSelectedItem; // Select 'Group Set 2 (Race Face, Fizik Arione)' in 'comboBox_handlebarSaddle' combo box uIComboBox_handlebarSaComboBox.SelectedItem = this.AddOrder_3Params.UIComboBox_handlebarSaComboBoxSelectedItem; // Select 'Extend warranty' check box uIExtendwarrantyCheckBox.Checked = this.AddOrder_3Params.UIExtendwarrantyCheckBoxChecked; // Click 'Add' button Mouse.Click(uIAddButton, new Point(13, 19)); }
/// <summary> /// SimulatronUITest - Use 'SimulatronUITestParams' to pass parameters into this method. /// </summary> public void SimulatronUITest() { #region Variable Declarations WinButton uIShowdesktopButton = this.UIItemWindow.UIShowdesktopButton; WpfCheckBox uICheckBoxCheckBox = this.UISimulatronWindowWindow.UICheckBoxCheckBox; WpfExpander uITemperatureExpander = this.UISimulatronWindowWindow.UITemperatureExpander; WpfButton uIResetButton = this.UISimulatronWindowWindow.UIResetButton; WinWindow uISimulatronWindowWindow1 = this.UISimulatronWindowWindow1; WpfTitleBar uISimulatronWindowTitleBar = this.UISimulatronWindowWindow.UISimulatronWindowTitleBar; #endregion // Click 'Show desktop' button Mouse.Click(uIShowdesktopButton, new Point(40, 12)); // Launch 'D:\Media\Univer\Labs\Git\IDE\Lab#2\Lab2\Lab2\bin\Debug\Lab2.exe' ApplicationUnderTest uISimulatronWindowWindow = ApplicationUnderTest.Launch(this.SimulatronUITestParams.UISimulatronWindowWindowExePath, this.SimulatronUITestParams.UISimulatronWindowWindowAlternateExePath); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.SimulatronUITestParams.UICheckBoxCheckBoxChecked; // Expand 'Temperature' expander uITemperatureExpander.Expanded = this.SimulatronUITestParams.UITemperatureExpanderExpanded; // Click 'Reset' button Mouse.Click(uIResetButton, new Point(32, 16)); // Double-Click 'SimulatronWindow' window Mouse.DoubleClick(uISimulatronWindowWindow1, new Point(1034, 343)); // Click 'SimulatronWindow' title bar Mouse.Click(uISimulatronWindowTitleBar, new Point(1137, -1)); }
/// <summary> /// TravTestRecordedMethod - Use 'TravTestRecordedMethodParams' to pass parameters into this method. /// </summary> private void TravTestRecordedMethod() { #region Variable Declarations WpfTabPage uIHelpTabPage = this.UIBusinessDesignStudioWindow.UIRibbonTabList.UIHelpTabPage; WpfTreeItem uIUI_SourceServer_BUGSTreeItem = this.UIBusinessDesignStudioWindow.UISourceNavigationViewCustom.UITvExplorerTree.UIDev2StudioViewModelsTreeItem.UIUI_SourceServer_WORKTreeItem.UIUI_SourceServer_BUGSTreeItem; WpfCheckBox uIUI_CheckBoxBUGS_AutoCheckBox = this.UIBusinessDesignStudioWindow.UISourceNavigationViewCustom.UITvExplorerTree.UIDev2StudioViewModelsTreeItem.UIUI_SourceServer_WORKTreeItem.UIUI_SourceServer_BUGSTreeItem.UIUI_CheckBoxBUGS_AutoCheckBox; WpfComboBox uIUI_DestinationServerComboBox = this.UIBusinessDesignStudioWindow.UIDeployResourcesCustom.UIDeployUserControlCustom.UIUI_DestinationServerComboBox; WpfButton uIDeployButton = this.UIBusinessDesignStudioWindow.UIDeployResourcesCustom.UIDeployUserControlCustom.UIDeployButton; #endregion // Click 'Help' tab Mouse.Click(uIHelpTabPage, new Point(304, 64)); // Expand 'Dev2.Studio.ViewModels.Navigation.EnvironmentTreeV...' -> 'UI_SourceServer_WORKFLOWS_AutoID' -> 'UI_SourceServer_BUGS_AutoID' tree item uIUI_SourceServer_BUGSTreeItem.Expanded = this.TravTestRecordedMethodParams.UIUI_SourceServer_BUGSTreeItemExpanded; // Select 'UI_CheckBoxBUGS_AutoID' check box uIUI_CheckBoxBUGS_AutoCheckBox.Checked = this.TravTestRecordedMethodParams.UIUI_CheckBoxBUGS_AutoCheckBoxChecked; // Select 'Dev2.Studio.Core.InterfaceImplementors.ServerDTO' in 'UI_DestinationServercbx_AutoID' combo box uIUI_DestinationServerComboBox.SelectedItem = this.TravTestRecordedMethodParams.UIUI_DestinationServerComboBoxSelectedItem; // Click 'Deploy' button Mouse.Click(uIDeployButton, new Point(25, 17)); }
/// <summary> /// /// </summary> /// <param name="window"></param> /// <param name="name"></param> /// <returns></returns> public static WpfCheckBox GetWpfCheckBoxByName(this WinWindow window, string name) { WpfCheckBox btn = new WpfCheckBox(window); btn.SearchProperties[WpfCheckBox.PropertyNames.Name] = name; return(btn); }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WpfCheckBox uIAllCheckBox = this.UIWarewolfDEV2SANELEMTWindow.UISearchViewUserControCustom.UISearchOptionsExpander.UIAllCheckBox; #endregion // Select 'All' check box uIAllCheckBox.Checked = this.RecordedMethod1Params.UIAllCheckBoxChecked; }
/// <summary> /// AssertMethod3 - Use 'AssertMethod3ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethod3() { #region Variable Declarations WpfCheckBox uIAutoGenerateColumnsCheckBox = this.UIAutomationC1WPFFlexGWindow.UIAutoGenerateColumnsCheckBox; #endregion // Verify that 'AutoGenerateColumns' check box's property 'AutomationId' equals 'chk_AutoGenerateColumns' Assert.AreEqual(this.AssertMethod3ExpectedValues.UIAutoGenerateColumnsCheckBoxAutomationId, uIAutoGenerateColumnsCheckBox.AutomationId); }
/// <summary> /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethod1() { #region Variable Declarations WpfCheckBox uIItemCheckBox = this.UITestAutomationWindow.UIFlexgridTable.UIRow0DataItem.UIItem01DataItem.UIItemCheckBox; #endregion // Verify that 'Unknown Name' check box's property 'ControlType' equals 'CheckBox' Assert.AreEqual(this.AssertMethod1ExpectedValues.UIItemCheckBoxControlType, uIItemCheckBox.ControlType.ToString()); }
public void selectCheckBox(string Name) { WpfCheckBox btn = new WpfCheckBox(this); btn.TechnologyName = "MSAA"; btn.SearchProperties[WpfCheckBox.PropertyNames.Name] = Name; if (!btn.Checked) { Mouse.Click(btn); } }
/// <summary> /// RecordedMethod2 - Use 'RecordedMethod2Params' to pass parameters into this method. /// </summary> public void RecordedMethod2() { #region Variable Declarations WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; #endregion // Click 'Start' button Mouse.Click(uIStartButton, new Point(945, 152)); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.RecordedMethod2Params.UICheckBoxCheckBoxChecked; }
/// <summary> /// Anh_20 - Use 'Anh_20Params' to pass parameters into this method. /// </summary> public void Anh_20() { #region Variable Declarations WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; WinButton uICloseButton = this.UIMainWindowWindow1.UICloseButton; #endregion // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.Anh_20Params.UICheckBoxCheckBoxChecked; // Click 'Close' button Mouse.Click(uICloseButton, new Point(51, 36)); }
public void ModifiedSimpleAppTest() { #region Variable Declarations WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; #endregion // Click 'Start' button Mouse.Click(uIStartButton, new Point(36, 7)); uICheckBoxCheckBox.WaitForControlEnabled(); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.SimpleAppTestParams.UICheckBoxCheckBoxChecked; }
/// <summary> /// Week09Test - Use 'Week09TestParams' to pass parameters into this method. /// </summary> public void Week09Test() { #region Variable Declarations WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; #endregion // Launch '%USERPROFILE%\Source\Repos\Week09\Week09\bin\Debug\Week09.exe' ApplicationUnderTest uIMainWindowWindow = ApplicationUnderTest.Launch(this.Week09TestParams.UIMainWindowWindowExePath, this.Week09TestParams.UIMainWindowWindowAlternateExePath); // Click 'Start' button Mouse.Click(uIStartButton, new Point(83, 11)); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.Week09TestParams.UICheckBoxCheckBoxChecked; }
public void VerifyCheckBoxEnabled(string name, bool enabled = true) { WpfCheckBox btn = new WpfCheckBox(this); btn.TechnologyName = "MSAA"; btn.SearchProperties[WpfCheckBox.PropertyNames.Name] = name; if (enabled) { Assert.IsTrue(btn.Enabled, "Checkbox should be enabled "); } else { Assert.IsFalse(btn.Enabled, "Checkbox should be disabled"); } }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WpfButton uIButtonButton = this.UIMainWindowWindow.UIButtonButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; #endregion // Launch '%USERPROFILE%\Source\Repos\Week9UITest\Week9App\bin\Debug\Week9App.exe' ApplicationUnderTest uIMainWindowWindow = ApplicationUnderTest.Launch(this.RecordedMethod1Params.UIMainWindowWindowExePath, this.RecordedMethod1Params.UIMainWindowWindowAlternateExePath); // Click 'Button' button Mouse.Click(uIButtonButton, new Point(38, 7)); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.RecordedMethod1Params.UICheckBoxCheckBoxChecked; }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; WinButton uICloseButton = this.UIMainWindowWindow1.UICloseButton; #endregion // Click 'Start' button Mouse.Click(uIStartButton, new Point(263, 284)); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.RecordedMethod1Params.UICheckBoxCheckBoxChecked; // Click 'Close' button Mouse.Click(uICloseButton, new Point(54, 37)); }
/// <summary> /// /// </summary> /// <param name="chk"></param> /// <param name="select"></param> public static void SelectCheckBox(this WpfCheckBox chk, bool select = true) { if (select) { if (!chk.Checked) { Mouse.Click(); } } else { if (chk.Checked) { Mouse.Click(); } } }
/// <summary> /// WPF_Sucks - Use 'WPF_SucksParams' to pass parameters into this method. /// </summary> public void WPF_Sucks() { #region Variable Declarations WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; WinButton uICloseButton = this.UIMainWindowWindow1.UICloseButton; #endregion // Click 'Start' button Mouse.Click(uIStartButton, new Point(878, 343)); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.WPF_SucksParams.UICheckBoxCheckBoxChecked; // Click 'Close' button Mouse.Click(uICloseButton, new Point(69, 22)); }
/// <summary> /// RecordedMethod1 - 使用“RecordedMethod1Params”将参数传递到此方法中。 /// </summary> public void RecordedMethod1() { #region Variable Declarations WinEdit uI名称Edit = this.UIDebugWindow.UIItemWindow.UISimpleWPFAppexeListItem.UI名称Edit; WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; #endregion // 双击 “名称” 文本框 Mouse.DoubleClick(uI名称Edit, new Point(95, 9)); // 单击 “Start” 按钮 Mouse.Click(uIStartButton, new Point(38, 15)); // 选择 “CheckBox” 复选框 uICheckBoxCheckBox.Checked = this.RecordedMethod1Params.UICheckBoxCheckBoxChecked; }
public void VerifyCheckBoxIsSelected(string Name, bool selected = true, string message = "") { WpfCheckBox btn = new WpfCheckBox(this); btn.TechnologyName = "MSAA"; btn.SearchProperties[WpfCheckBox.PropertyNames.Name] = Name; if (selected) { message = message == "" ? "Checkbox: " + Name + " is selected as expected" : message; Assert.IsTrue(btn.Checked, message); } else { message = message == "" ? "Checkbox: " + Name + " is not Selected as expected" : message; Assert.IsFalse(btn.Checked, message); } }
public void AutoGenerateColumns() { var window = new WpfWindow(); window.SearchProperties[WpfWindow.PropertyNames.Name] = "C1FlexGrid Automation Test"; var chk_AutoGenerateColumns = new WpfCheckBox(window); chk_AutoGenerateColumns.SearchProperties[WpfCheckBox.PropertyNames.AutomationId] = "chk_AutoGenerateColumns"; var flexgrid = new WpfTable(window); flexgrid.SearchProperties[WpfTable.PropertyNames.AutomationId] = "flexgrid"; var msg = "Default:" + flexgrid.ColumnCount; chk_AutoGenerateColumns.Checked = false; msg += ".False:" + flexgrid.ColumnCount; chk_AutoGenerateColumns.Checked = true; Assert.AreEqual("Default:7.False:3", msg); }
public void ModifiedButtonClick() { #region Variable Declarations WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; #endregion // Launch '%USERPROFILE%\source\repos\SimpleWPFApplication\SimpleWPFApplication\bin\Debug\SimpleWPFApplication.exe' ApplicationUnderTest uIMainWindowWindow = ApplicationUnderTest.Launch(this.ButtonClickParams.UIMainWindowWindowExePath, this.ButtonClickParams.UIMainWindowWindowAlternateExePath); // Click 'Start' button Mouse.Click(uIStartButton, new Point(50, 8)); uICheckBoxCheckBox.WaitForControlEnabled(); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.ButtonClickParams.UICheckBoxCheckBoxChecked; }
/// <summary> /// SimpleAppTest - Use 'SimpleAppTestParams' to pass parameters into this method. /// </summary> public void ModifiedSimpleAppTest() { #region Variable Declarations WpfButton uIButtonButton = this.UIMainWindowWindow.UIButtonButton1; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; WinButton uICloseButton = this.UIMainWindowWindow1.UICloseButton; #endregion // Click 'Button' button Mouse.Click(uIButtonButton, new Point(46, 14)); uICheckBoxCheckBox.WaitForControlEnabled(); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.SimpleAppTestParams.UICheckBoxCheckBoxChecked; // Click 'Close' button Mouse.Click(uICloseButton, new Point(50, 35)); }
/// <summary> /// RecordedMethod3 - Use 'RecordedMethod3Params' to pass parameters into this method. /// </summary> public void RecordedMethod3() { #region Variable Declarations WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; WinButton uICloseButton = this.UIMainWindowWindow1.UICloseButton; #endregion // Launch '%USERPROFILE%\source\repos\SimpleWPFApp\SimpleWPFApp\obj\Debug\SimpleWPFApp.exe' ApplicationUnderTest uIMainWindowWindow = ApplicationUnderTest.Launch(this.RecordedMethod3Params.UIMainWindowWindowExePath, this.RecordedMethod3Params.UIMainWindowWindowAlternateExePath); // Click 'Start' button Mouse.Click(uIStartButton, new Point(103, 202)); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.RecordedMethod3Params.UICheckBoxCheckBoxChecked; // Click 'Close' button Mouse.Click(uICloseButton, new Point(28, 37)); }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; WinButton uICloseButton = this.UIMainWindowWindow1.UICloseButton; #endregion // Launch '%USERPROFILE%\Documents\GitHub\WeeklyTaskAutoUITesting-\WeeklyTaskAutoUITestingWPFApp\bin\Debug\WeeklyTaskAutoUITestingWPFApp.exe' ApplicationUnderTest uIMainWindowWindow = ApplicationUnderTest.Launch(this.RecordedMethod1Params.UIMainWindowWindowExePath, this.RecordedMethod1Params.UIMainWindowWindowAlternateExePath); // Click 'Start' button Mouse.Click(uIStartButton, new Point(27, 17)); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.RecordedMethod1Params.UICheckBoxCheckBoxChecked; // Click 'Close' button Mouse.Click(uICloseButton, new Point(17, 2)); }
/// <summary> /// SimpleTests2 - Use 'SimpleTests2Params' to pass parameters into this method. /// </summary> public void SimpleTests2() { #region Variable Declarations WpfButton uIStartbuttonA = this.UIMainWindowWindow.UIStartbuttonA; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; WinButton uICloseButton = this.UIMainWindowWindow1.UICloseButton; #endregion // Launch '%USERPROFILE%\source\repos\SimpleWPFapp\SimpleWPFapp\bin\Debug\SimpleWPFapp.exe' ApplicationUnderTest uIMainWindowWindow = ApplicationUnderTest.Launch(this.SimpleTests2Params.UIMainWindowWindowExePath, this.SimpleTests2Params.UIMainWindowWindowAlternateExePath); // Click 'Start' button Mouse.Click(uIStartbuttonA, new Point(79, 10)); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.SimpleTests2Params.UICheckBoxCheckBoxChecked; // Click 'Close' button Mouse.Click(uICloseButton, new Point(13, 28)); }
/// <summary> /// SimpleTestMethod - Use 'SimpleTestMethodParams' to pass parameters into this method. /// </summary> public void Modified1SimpleTestMethod() { #region Variable Declarations WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton; WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox; WinButton uICloseButton = this.UIMainWindowWindow1.UICloseButton; #endregion // Launch '%USERPROFILE%\Desktop\101604238\Week 9\SimpleWPFApp\SimpleWPFApp\bin\Debug\SimpleWPFApp.exe' ApplicationUnderTest uIMainWindowWindow = ApplicationUnderTest.Launch(this.SimpleTestMethodParams.UIMainWindowWindowExePath, this.SimpleTestMethodParams.UIMainWindowWindowAlternateExePath); // Click 'Start' button Mouse.Click(uIStartButton, new Point(54, 11)); uICheckBoxCheckBox.WaitForControlEnabled(); // Select 'CheckBox' check box uICheckBoxCheckBox.Checked = this.SimpleTestMethodParams.UICheckBoxCheckBoxChecked; // Click 'Close' button Mouse.Click(uICloseButton, new Point(32, 12)); }
private WpfCheckBox GetTaskItemStatus(int id) { var listItem = getListItem(id); var t = new WpfCheckBox(listItem); string auto_id = "Task_" + id + "-Toggle"; t.SearchProperties[WpfCheckBox.PropertyNames.AutomationId] = auto_id; t.WindowTitles.Add("ToDoList"); return t; }
public void AutoGenerateColumns() { var window = new WpfWindow(); window.SearchProperties[WpfWindow.PropertyNames.Name] = "C1FlexGrid Automation Test"; var chk_AutoGenerateColumns=new WpfCheckBox(window); chk_AutoGenerateColumns.SearchProperties[WpfCheckBox.PropertyNames.AutomationId] = "chk_AutoGenerateColumns"; var flexgrid = new WpfTable(window); flexgrid.SearchProperties[WpfTable.PropertyNames.AutomationId] = "flexgrid"; var msg = "Default:" + flexgrid.ColumnCount; chk_AutoGenerateColumns.Checked = false; msg += ".False:" + flexgrid.ColumnCount; chk_AutoGenerateColumns.Checked = true; Assert.AreEqual("Default:7.False:3", msg); }
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; } }