public void TestInitialize() { if (Process.GetProcessesByName(TestProcess).Length == 0) { testApp = ApplicationUnderTest.Launch(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, TestProcess + ".exe")); } }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WinEdit uIBillTextBoxEdit = this.UIForm1Window.UIBillTextBoxWindow.UIBillTextBoxEdit; WpfControl uIEnterTotalBillEdit = this.UIForm1Window.UIEnterTotalBillEdit; WinWindow uITipBoxWindow = this.UIForm1Window.UIForm1Client.UITipBoxWindow; WinEdit uITipBoxEdit = this.UIForm1Window.UITipBoxWindow.UITipBoxEdit; WinClient uIForm1Client = this.UIForm1Window.UIForm1Client; WinButton uIComputeTipButton = this.UIForm1Window.UIComputeTipWindow.UIComputeTipButton; #endregion // Launch '%USERPROFILE%\source\repos\u1190338\Labs\Lab6\Lab6\bin\Debug\Lab6.exe' ApplicationUnderTest uIForm1Window = ApplicationUnderTest.Launch(this.RecordedMethod1Params.UIForm1WindowExePath, this.RecordedMethod1Params.UIForm1WindowAlternateExePath); // Click 'BillTextBox' text box Mouse.Click(uIBillTextBoxEdit, new Point(61, 4)); // Double-Click 'BillTextBox' text box Mouse.DoubleClick(uIBillTextBoxEdit, new Point(61, 4)); // Type '100' in 'Enter Total Bill' text box Keyboard.SendKeys(uIEnterTotalBillEdit, this.RecordedMethod1Params.UIEnterTotalBillEditSendKeys, ModifierKeys.None); // Click 'TipBox' window Mouse.Click(uITipBoxWindow, new Point(32, 1)); // Type '20' in 'TipBox' text box uITipBoxEdit.Text = this.RecordedMethod1Params.UITipBoxEditText; // Click 'Form1' client Mouse.Click(uIForm1Client, new Point(301, 303)); // Click 'Compute Tip' button Mouse.Click(uIComputeTipButton, new Point(132, 22)); }
/// <summary> /// Просмотр ошибок начального окна /// </summary> public void CheckErrors() { #region Variable Declarations WinButton uIВставитьButton = this.UITestingWindow.UIВставитьWindow.UIВставитьButton; WinButton uIОКButton = this.UIERRORWindow.UIОКWindow.UIОКButton; WinButton uIЗапускButton = this.UITestingWindow.UIЗапускWindow.UIЗапускButton; WinButton uIВыходButton = this.UITestingWindow.UIВыходWindow.UIВыходButton; #endregion // Запуск "%OneDrive%\Рабочий стол\LabsForTesting.exe" ApplicationUnderTest uITestingWindow = ApplicationUnderTest.Launch(this.CheckErrorsParams.UITestingWindowExePath, this.CheckErrorsParams.UITestingWindowAlternateExePath); // Щелкните "Вставить" кнопка Mouse.Click(uIВставитьButton, new Point(107, 24)); // Щелкните "ОК" кнопка Mouse.Click(uIОКButton, new Point(59, 23)); // Щелкните "Запуск!" кнопка Mouse.Click(uIЗапускButton, new Point(130, 36)); // Щелкните "ОК" кнопка Mouse.Click(uIОКButton, new Point(59, 15)); // Щелкните "Выход" кнопка Mouse.Click(uIВыходButton, new Point(217, 25)); }
/// <summary> /// AuditRoundTripPerformance - Use 'AuditRoundTripPerformanceParams' to pass parameters into this method. /// </summary> public void AuditRoundTripPerformance() { #region Variable Declarations WinHyperlink uIItem01sumdatxlsHyperlink = this.UIExcelWindow.UIItem01sumdatxlsListItem.UIItem01sumdatxlsHyperlink; WinTabPage uIExceLintTabPage = this.UIExcelWindow.UIItemWindow.UIRibbonClient.UIExceLintTabPage; WinButton uIAuditButton = this.UIExcelWindow.UIItemWindow.UIItemToolBar.UIAuditButton; WinButton uIStartOverButton = this.UIExcelWindow.UIItemWindow.UIItemToolBar.UIStartOverButton; WinButton uICloseButton = this.UIExcelWindow.UIItemWindow.UIRibbonPropertyPage.UICloseButton; WinButton uIDontSaveButton = this.UIMicrosoftExcelWindow.UIMicrosoftExcelDialog.UIDontSaveButton; #endregion // Launch '%ProgramFiles(x86)%\Microsoft Office\root\Office16\EXCEL.EXE' ApplicationUnderTest eXCELApplication = ApplicationUnderTest.Launch(this.AuditRoundTripPerformanceParams.ExePath, this.AuditRoundTripPerformanceParams.AlternateExePath); // Click '01sumdat.xls' link Mouse.Click(uIItem01sumdatxlsHyperlink, new Point(186, 14)); // Click 'ExceLint' tab Mouse.Click(uIExceLintTabPage, new Point(21, 13)); // Click 'Audit' button Mouse.Click(uIAuditButton, new Point(27, 29)); // Click 'Start Over' button Mouse.Click(uIStartOverButton, new Point(20, 30)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(20, 10)); // Click 'Don't Save' button Mouse.Click(uIDontSaveButton, new Point(50, 18)); }
/// <summary> /// Paste the selected text /// </summary> public void PasteAction() { #region Variable Declarations WinEdit uIRTBEdit = this.UITextEditorWindow.UIRTBWindow.UIRTBEdit; WinMenuItem uICutMenuItem = this.UITextEditorWindow.UIMenuStrip1MenuBar.UIEditMenuItem.UICutMenuItem; WinMenuItem uIPasteMenuItem = this.UITextEditorWindow.UIMenuStrip1MenuBar.UIEditMenuItem.UIPasteMenuItem; #endregion // Launch '\\obs-lancia\students\arya1516\TextEditor\TextEditor\bin\Debug\TextEditor.vshost.exe' ApplicationUnderTest uITextEditorWindow = ApplicationUnderTest.Launch(this.PasteActionParams.UITextEditorWindowExePath, this.PasteActionParams.UITextEditorWindowAlternateExePath); // The recording for the application under test '\\obs-lancia\students\arya1516\TextEditor\TextEditor\bin\Debug\TextEditor.vshost.exe' may not be correct as it is located on a network share. Please install the application on a local path. // Type 'Hello my name is ' in 'RTB' text box uIRTBEdit.Text = this.PasteActionParams.UIRTBEditText; // Move 'RTB' text box Mouse.StartDragging(uIRTBEdit, new Point(80, 7)); Mouse.StopDragging(uIRTBEdit, -28, 4); // Click 'Edit' -> 'Cut' menu item Mouse.Click(uICutMenuItem, new Point(39, 9)); // Click 'Edit' -> 'Paste' menu item Mouse.Click(uIPasteMenuItem, new Point(51, 5)); }
/// <summary> /// LaunchReview - Use 'LaunchReviewParams' to pass parameters into this method. /// </summary> public void LaunchReview() { // Launch '%SmartViewDir%\Review.exe' ApplicationUnderTest reviewApplication = ApplicationUnderTest.Launch(this.LaunchReviewParams.ExePath, this.LaunchReviewParams.AlternateExePath); ConfirmAlreadyReviewRunningMessage(); }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WinListItem uIFileAnalyzerShortcutListItem = this.UIProgramManagerWindow.UIDesktopList.UIFileAnalyzerShortcutListItem; WinMenuItem uIOpenMenuItem = this.UIFileAnalyzerWindow.UIMenuBarMenuBar.UIFileMenuItem.UIOpenMenuItem; WinEdit uINameEdit = this.UIOpenWindow.UIItemWindow.UITwoCitiesListItem.UINameEdit; WinSplitButton uIOpenSplitButton = this.UIOpenWindow.UIOpenWindow1.UIOpenSplitButton; WinEdit uISubstringBoxEdit = this.UIFileAnalyzerWindow.UISubstringBoxWindow.UISubstringBoxEdit; WinButton uICountButton = this.UIFileAnalyzerWindow.UICountWindow.UICountButton; #endregion // Double-Click 'FileAnalyzer - Shortcut' list item Mouse.DoubleClick(uIFileAnalyzerShortcutListItem, new Point(53, 33)); // Double-Click 'FileAnalyzer - Shortcut' list item Mouse.DoubleClick(uIFileAnalyzerShortcutListItem, new Point(40, 27)); // Launch '%USERPROFILE%\Source\CS 3500 S16\examples\FileAnalyzer\FileAnalyzer5\bin\Debug\FileAnalyzer.exe' ApplicationUnderTest uIFileAnalyzerWindow = ApplicationUnderTest.Launch(this.RecordedMethod1Params.UIFileAnalyzerWindowExePath, this.RecordedMethod1Params.UIFileAnalyzerWindowAlternateExePath); // Click 'File' -> 'Open ...' menu item Mouse.Click(uIOpenMenuItem, new Point(53, 11)); // Click 'Name' text box Mouse.Click(uINameEdit, new Point(43, 18)); // Click '&Open' split button Mouse.Click(uIOpenSplitButton, new Point(41, 15)); // Type 'the' in 'substringBox' text box uISubstringBoxEdit.Text = this.RecordedMethod1Params.UISubstringBoxEditText; // Click 'Count' button Mouse.Click(uICountButton, new Point(32, 12)); }
public void testmethods() { ApplicationUnderTest note = ApplicationUnderTest.Launch("C:\\Windows\\System32\\notepad.exe"); UITestControl num = new UITestControl(); num.TechnologyName = "MSAA"; num.SearchProperties[UITestControl.PropertyNames.Name] = "Untitled - Notepad"; UITestControl but = new WinButton(num); UITestControlCollection control = but.FindMatchingControls(); var controlbutton = control.GetNamesOfControls(); foreach (var c in controlbutton) { Keyboard.SendKeys(c + "\n"); } // var Ocr = new AutoOcr(); //var Result = Ocr.Read(@"C:\Users\shravya.shastri\Desktop\qrcode.png"); // Console.WriteLine(Result.Text); // string n = Result.ToString(); // method.launch(); // Keyboard.SendKeys(n); // method.filemethod(); // method.savemethod(); // method.scenarios(); //mouse.rightclickmethod(); }
/// <summary> /// Insert double into cell /// </summary> public void RecordedMethod1() { #region Variable Declarations WinListItem uIRecycleBinListItem = this.UIItemWindow.UIFolderViewWindow.UIRecycleBinListItem; WinListItem uIMozillaFirefoxListItem = this.UIItemWindow.UIFolderViewWindow.UIMozillaFirefoxListItem; WinEdit uICellContentsValueEdit = this.UISpreadsheetWindow.UICellContentsValueWindow.UICellContentsValueEdit; #endregion // Launch '%windir%\SysWOW64\WerFault.exe' with arguments '-u -p 1560 -s 592' ApplicationUnderTest werFaultApplication = ApplicationUnderTest.Launch(this.RecordedMethod1Params.ExePath, this.RecordedMethod1Params.AlternateExePath, "-u -p 1560 -s 592"); // Launch '%USERPROFILE%\Source\Repos\cs3500\Spreadsheet\SpreadsheetGUI\bin\Debug\SpreadsheetGUI.exe' ApplicationUnderTest uISpreadsheetWindow = ApplicationUnderTest.Launch(this.RecordedMethod1Params.UISpreadsheetWindowExePath, this.RecordedMethod1Params.UISpreadsheetWindowAlternateExePath); // Click 'Recycle Bin' list item Mouse.Click(uIRecycleBinListItem, new Point(110, 115)); // Click 'Recycle Bin' list item Mouse.Click(uIRecycleBinListItem, new Point(110, 115)); // Click 'Mozilla Firefox' list item Mouse.Click(uIMozillaFirefoxListItem, new Point(143, 45)); // Type '5' in 'cellContentsValue' text box uICellContentsValueEdit.Text = this.RecordedMethod1Params.UICellContentsValueEditText; // Type '{Enter}' in 'cellContentsValue' text box Keyboard.SendKeys(uICellContentsValueEdit, this.RecordedMethod1Params.UICellContentsValueEditSendKeys, ModifierKeys.None); }
public void Test_Windows_Calculator() { var app = ApplicationUnderTest.Launch(@"C:\Windows\system32\calc.exe"); var button5 = new WinButton(app); button5.SearchProperties.Add(WinControl.PropertyNames.Name, "5"); Mouse.Click(button5); var buttonPlus = new WinButton(app); buttonPlus.SearchProperties.Add(WinControl.PropertyNames.Name, "Add"); Mouse.Click(buttonPlus); Mouse.Click(button5); var buttonEquals = new WinButton(app); buttonEquals.SearchProperties.Add(WinControl.PropertyNames.Name, "Equals"); Mouse.Click(buttonEquals); var resultText = new WinText(app); resultText.SearchProperties.Add(WinControl.PropertyNames.Name, "Result"); Assert.AreEqual("10", resultText.DisplayText); }
/// <summary> /// Loar a Large File. Change first Cell /// </summary> public void testLoad1() { #region Variable Declarations WinEdit uIContentBoxEdit = this.UINewSpreadsheetWindow.UIContentBoxWindow.UIContentBoxEdit; WinComboBox uIFilenameComboBox = this.UIOpenWindow.UIItemWindow.UIFilenameComboBox; WinEdit uIFilenameEdit = this.UIOpenWindow.UIItemWindow1.UIFilenameEdit; WinEdit uIContentBoxEdit1 = this.UICUsersnerd3DocumentsWindow.UIItem10Window.UIContentBoxEdit; #endregion // Launch '%USERPROFILE%\Source\Repos\cs3500\PS4\SpreadsheetGUI\bin\Debug\SpreadsheetGUI.exe' ApplicationUnderTest uINewSpreadsheetWindow = ApplicationUnderTest.Launch(this.testLoad1Params.UINewSpreadsheetWindowExePath, this.testLoad1Params.UINewSpreadsheetWindowAlternateExePath); // Type 'Control + o' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, this.testLoad1Params.UIContentBoxEditSendKeys, ModifierKeys.Control); // Select 'testFile' in 'File name:' combo box uIFilenameComboBox.EditableItem = this.testLoad1Params.UIFilenameComboBoxEditableItem; // Type 'Alt + o' in 'File name:' text box Keyboard.SendKeys(uIFilenameEdit, this.testLoad1Params.UIFilenameEditSendKeys, ModifierKeys.Alt); // Type '42' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit1, this.testLoad1Params.UIContentBoxEditText); // Type '{Enter}' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit1, this.testLoad1Params.UIContentBoxEditSendKeys1, ModifierKeys.None); // Type 'Control + s' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit1, this.testSave1Params.UIContentBoxEditSendKeys1, ModifierKeys.Control); }
/// <summary> /// Save a new Spreadsheet. Test Arrow Keys too /// </summary> public void testSave1() { #region Variable Declarations WinEdit uIContentBoxEdit = this.UINewSpreadsheetWindow.UIContentBoxWindow.UIContentBoxEdit; WinComboBox uIFilenameComboBox = this.UISaveAsWindow.UIDetailsPanePane.UIFilenameComboBox; WinEdit uIFilenameEdit = this.UISaveAsWindow.UIItemWindow.UIFilenameEdit; #endregion // Launch '%USERPROFILE%\Source\Repos\cs3500\PS4\SpreadsheetGUI\bin\Debug\SpreadsheetGUI.exe' ApplicationUnderTest uINewSpreadsheetWindow = ApplicationUnderTest.Launch(this.testSave1Params.UINewSpreadsheetWindowExePath, this.testSave1Params.UINewSpreadsheetWindowAlternateExePath); // Type '{Down}{Right}{Up}{Left}{LControlKey}' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, this.testSave1Params.UIContentBoxEditSendKeys, ModifierKeys.None); // Type 'Control + s' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, this.testSave1Params.UIContentBoxEditSendKeys1, ModifierKeys.Control); // Select 'testFile' in 'File name:' combo box Keyboard.SendKeys(uIFilenameComboBox, this.testSave1Params.UIFilenameComboBoxEditableItem); // Type 'Alt + s' in 'File name:' text box Keyboard.SendKeys(uIFilenameEdit, this.testSave1Params.UIFilenameEditSendKeys, ModifierKeys.Alt); // Type '=a2' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, "=a2"); // Type '{Enter}' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, "{Enter}"); // Type 'Control + s' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, this.testSave1Params.UIContentBoxEditSendKeys1, ModifierKeys.Control); }
/// <summary> /// new spreadsheet and close /// </summary> public void testNew1() { #region Variable Declarations WinEdit uIContentBoxEdit = this.UINewSpreadsheetWindow.UIContentBoxWindow.UIContentBoxEdit; WinEdit uIContentBoxEdit1 = this.UINewSpreadsheetWindow1.UIContentBoxWindow.UIContentBoxEdit; #endregion // Launch '%USERPROFILE%\Source\Repos\cs3500\PS4\SpreadsheetGUI\bin\Debug\SpreadsheetGUI.exe' ApplicationUnderTest uINewSpreadsheetWindow = ApplicationUnderTest.Launch(this.testNew1Params.UINewSpreadsheetWindowExePath, this.testNew1Params.UINewSpreadsheetWindowAlternateExePath); // Type '{F11}' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, this.testNew1Params.UIContentBoxEditSendKeys, ModifierKeys.None); // Type '{F11}' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, this.testNew1Params.UIContentBoxEditSendKeys, ModifierKeys.None); // Type 'Control + n' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, this.testNew1Params.UIContentBoxEditSendKeys2, ModifierKeys.Control); // Type 'Alt + {F4}' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit1, this.testNew1Params.UIContentBoxEditSendKeys3, ModifierKeys.Alt); // Type '{F1}' in 'contentBox' text box Keyboard.SendKeys(uIContentBoxEdit, this.testNew1Params.UIContentBoxEditSendKeys1, ModifierKeys.None); }
public static ApplicationUnderTest LaunchEllis() { App = ApplicationUnderTest.Launch(TestData.Path, TestData.AltPath); Factory.GetWinProperties(); return(App); }
public void FirstRecordAndPlayTest() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. //this.UIMap.mRemoteNGTest(); ApplicationUnderTest.Launch(@"D:\Project2\MyCalculatorv1.exe"); this.UIMap.additionTwoValues(); }
/// <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)); }
public void SecondRecordAndPlayTestWithAssertions() { ApplicationUnderTest.Launch(@"D:\Project2\MyCalculatorv1.exe"); this.UIMap.CleanResultField(); this.UIMap.MethodToMultiply(); this.UIMap.AssertMultiplication(); }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WinButton uIItem2Button = this.UICalculatorWindow.UIItemWindow.UIItem2Button; WinButton uIAddButton = this.UICalculatorWindow.UIItemWindow1.UIAddButton; WinButton uIItem9Button = this.UICalculatorWindow.UIItemWindow2.UIItem9Button; WinButton uIEqualsButton = this.UICalculatorWindow.UIItemWindow3.UIEqualsButton; WinButton uISubtractButton = this.UICalculatorWindow.UIItemWindow4.UISubtractButton; WinButton uIItem1Button = this.UICalculatorWindow.UIItemWindow5.UIItem1Button; #endregion // Launch '%windir%\System32\calc.exe' ApplicationUnderTest uICalculatorWindow = ApplicationUnderTest.Launch(this.RecordedMethod1Params.UICalculatorWindowExePath, this.RecordedMethod1Params.UICalculatorWindowAlternateExePath); // Click '2' button Mouse.Click(uIItem2Button, new Point(23, 14)); // Click 'Add' button Mouse.Click(uIAddButton, new Point(22, 16)); // Click '9' button Mouse.Click(uIItem9Button, new Point(19, 4)); // Click 'Equals' button Mouse.Click(uIEqualsButton, new Point(24, 34)); // Click 'Subtract' button Mouse.Click(uISubtractButton, new Point(17, 11)); // Click '1' button Mouse.Click(uIItem1Button, new Point(21, 14)); // Click 'Equals' button Mouse.Click(uIEqualsButton, new Point(27, 27)); }
public void BrisanjeIzXML() { ApplicationUnderTest.Launch(System.Reflection.Assembly.GetAssembly(typeof(Form1)).Location); this.UIMap.brisanjeKreiranog(); // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. }
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> /// AddingNewCategory - Use 'AddingNewCategoryParams' to pass parameters into this method. /// </summary> public void AddingNewCategory() { #region Variable Declarations WinPane uIListakategoriimojaapPane = this.UIListakategoriimojaapWindow.UIListakategoriimojaapPane; WinPane uIHomePagemojaaplikacjPane = this.UIListakategoriimojaapWindow.UIHomePagemojaaplikacjPane; WinPane uICreatemojaaplikacjapPane = this.UIListakategoriimojaapWindow.UICreatemojaaplikacjapPane; WinControl uICreatemojaaplikacjapDocument = this.UIListakategoriimojaapWindow.UIChromeLegacyWindowWindow.UICreatemojaaplikacjapDocument; #endregion // Click 'Lista kategorii — moja aplikacja platformy ASP.NET...' pane Mouse.Click(uIListakategoriimojaapPane, new Point(416, 225)); // Launch '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\ScriptedSandbox64.exe' with arguments '"Software\Microsoft\VisualStudio\15.0_5bd3f5c7\ScriptedPlugins" "Software\Microsoft\VisualStudio\15.0_5bd3f5c7_Config\ScriptedPlugins" 1098e 2f24 "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/PrivateAssemblies/plugin.vs.js"' ApplicationUnderTest scriptedSandbox64Application = ApplicationUnderTest.Launch(this.AddingNewCategoryParams.ExePath, this.AddingNewCategoryParams.AlternateExePath, "\"Software\\Microsoft\\VisualStudio\\15.0_5bd3f5c7\\ScriptedPlugins\" \"Software\\Microso" + "ft\\VisualStudio\\15.0_5bd3f5c7_Config\\ScriptedPlugins\" 1098e 2f24 \"C:/Program Fil" + "es (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/PrivateAssemblies/p" + "lugin.vs.js\""); // Click 'Home Page — moja aplikacja platformy ASP.NET - Goo...' pane Mouse.Click(uIHomePagemojaaplikacjPane, new Point(816, 128)); // Click 'Lista kategorii — moja aplikacja platformy ASP.NET...' pane Mouse.Click(uIListakategoriimojaapPane, new Point(439, 225)); // Click 'Create — moja aplikacja platformy ASP.NET - Google...' pane Mouse.Click(uICreatemojaaplikacjapPane, new Point(670, 280)); // Type 'Kategoria 8' in 'Create — moja aplikacja platformy ASP.NET - Google...' document Keyboard.SendKeys(uICreatemojaaplikacjapDocument, this.AddingNewCategoryParams.UICreatemojaaplikacjapDocumentSendKeys, ModifierKeys.None); // Click 'Create — moja aplikacja platformy ASP.NET - Google...' pane Mouse.Click(uICreatemojaaplikacjapPane, new Point(633, 343)); }
public void AUT_Open() { string AUTExecutable = ConfigurationManager.AppSettings["AUTExecutable"]; _aut = ApplicationUnderTest.Launch(AUTExecutable); _aut.CloseOnPlaybackCleanup = false; }
public void CodedUITestMethod1() { ApplicationUnderTest.Launch(@"C:\Windows\System32\calc.exe"); // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. this.UIMap.Add(); this.UIMap.AssertAddition(); }
/// <summary> /// LaunchConsole - Use 'LaunchConsoleParams' to pass parameters into this method. /// </summary> public void LaunchConsole() { // Launch '%SmartViewDir%\Console.exe' ApplicationUnderTest consoleApplication = ApplicationUnderTest.Launch(this.LaunchConsoleParams.ExePath, this.LaunchConsoleParams.AlternateExePath); ConfirmOnlyOneConsoleCanRunMessage(); }
public void TestInitialize() { string applicationFilePath = Path.Combine(TestContext.DeploymentDirectory, ApplicationFileName); ApplicationUnderTest.Launch(applicationFilePath); mainScreen = new MainScreen(); }
public void Start() { app = ApplicationUnderTest.Launch(path); Playback.Wait(1000); app.CloseOnPlaybackCleanup = false; app.SearchProperties[ApplicationUnderTest.PropertyNames.Name] = "Calculator"; app.SearchProperties[ApplicationUnderTest.PropertyNames.ClassName] = "CalcFrame"; }
public void CodedUITestMethod1() { ApplicationUnderTest.Launch(@"..\..\..\M120-LB2-FS16\bin\Debug\M120-LB2-FS16.exe"); // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. this.UIMap.CreateJobDouble(); this.UIMap.CheckEditJobDouble(); this.UIMap.CleanUpJobDouble(); }
public void MyTestInitialize() { calc_ = ApplicationUnderTest.Launch(@"C:\Windows\System32\calc1.exe"); // Start in standard mode. Mouse.Click(UIMap.UICalculatorWindow.UIApplicationMenuBar.UIViewMenuItem .UIStandardAlt1MenuItem); }
public void MyTestInitialize() { // this.UIMap.StartApp(); ApplicationUnderTest.Launch(@"I:\euler\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe"); // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. }
public void CustomClass_ButtonClick() { ApplicationUnderTest.Launch(@"C:\Windows\System32\calc.exe"); // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. CustomInvokerClass obj = new CustomInvokerClass(); obj.CallButtonClick(); }