public FormModel() { MainWindow = new WinWindow(By.Name("Form1")); lbl_ChangingText = MainWindow.Find<WinText>(By.Name("lbl_ChangingText")); btn_ChangeTxt = MainWindow.Find<WinButton>(By.Name("btn_ChangingText")); txtBox_ChangingBox = MainWindow.Find<WinEdit>(By.Name("txtBox_ChangingText")); }
static void Main(string[] args) { Playback.Initialize(); WinWindow GetCUITWindow = new WinWindow(); GetCUITWindow.SearchProperties.Add(WinWindow.PropertyNames.ControlName, "BrowserMain"); //UITestControlCollection allwnds = GetCUITWindow.FindMatchingControls(); //GetCUITWindow = (WinWindow)allwnds[0]; #region usingautoid //UITestControlCollection wndCollection = GetCUITWindow.FindMatchingControls(); //foreach (UITestControl inwin in wndCollection) //{ // if (inwin.TechnologyName == "MSAA" && ((WinWindow)inwin).ControlName == "BrowserMain") // { // GetCUITWindow = (WinWindow)inwin; // } //} #endregion // GetCUITWindow.SearchProperties.Add(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains); WinButton btn = new WinButton(GetCUITWindow); btn.SearchProperties.Add(WinButton.PropertyNames.Name, "Add a New Well"); Mouse.Click(btn); Playback.Cleanup(); }
/// <inheritdoc /> public override bool HandleDialog(Window window) { if (CanHandleDialog(window)) { window.ToFront(); window.SetActivate(); var inputBoxHwnd = new Hwnd(NativeMethods.GetChildWindowHwnd(window.Hwnd, "Edit")); if (inputBoxHwnd.hwnd == IntPtr.Zero) return false; if (_cancel) { window.ForceClose(); } else { inputBoxHwnd.SetFocus(); inputBoxHwnd.SendString(_input); var okButton = new WinButton(1, window.Hwnd); okButton.Click(); } return true; } return false; }
public static bool WaitApplicationLoad() { WinButton button = new WinButton(); while(!button.WaitForControlExist()) { PlayBack.Wait(5000); } }
public static void ClickWindowButton(string windowtitle, string buttontext) { WinWindow addposn = new WinWindow(); addposn.SearchProperties.Add(WinWindow.PropertyNames.Name, windowtitle, PropertyExpressionOperator.Contains); WinButton addposbtn = new WinButton(addposn); addposbtn.SearchProperties.Add(WinButton.PropertyNames.Name, buttontext); Mouse.Click(addposbtn); }
public static void ClickMaximizeButton(WinWindow parentWindow) { if (parentWindow.Maximized == false) { WinTitleBar titleBar = new WinTitleBar(parentWindow); WinButton maxButton = new WinButton(titleBar); maxButton.SearchProperties.Add("Name", "Maximize"); maxButton.WaitForControlReady(); Mouse.Click(maxButton, new Point(maxButton.Width / 2, maxButton.Height / 2)); } }
public static void ClickMinimizeMenuGroup(string groupName, WinWindow parent) { //Minimise all group controls WinGroup group = UIControls.GetGroupControl(groupName, parent); if (group.Height > 29) { WinButton arrowButton = new WinButton(UIControls.GetGroupedControl("CollapseChevron", "Button", groupName, parent)); Mouse.Click(arrowButton, new Point(arrowButton.Width / 2, arrowButton.Height / 2)); } }
// Mark To Be Deleted opened Item (if possble) public static void MarkToBeDeleted() { var active = new WinButton(WindowMaintance()); active.SearchProperties[UITestControl.PropertyNames.Name] = "Active"; var toBeDeleted = new WinMenuItem(WindowMaintance()); toBeDeleted.SearchProperties[UITestControl.PropertyNames.Name] = "To be Deleted"; Mouse.Click(active); Mouse.Click(toBeDeleted); Keyboard.SendKeys("{Enter}"); Keyboard.SendKeys(WindowMaintance(), "x", (ModifierKeys.Control | ModifierKeys.Shift)); }
public override bool HandleDialog(Window window) { if (CanHandleDialog(window)) { var buttonId = _clickOnOK ? okButtonId : cancelButtonId; var button = new WinButton(buttonId, window.Hwnd); button.Click(); return true; } return false; }
static WinButton GetFileNoteButton() { var window = GetWordWindow(); var ribbonWindow = GetWordRibbon(window); var templatesToolbar = new WinToolBar(ribbonWindow); templatesToolbar.SearchProperties[WinToolBar.PropertyNames.Name] = "Templates"; templatesToolbar.WindowTitles.Add("Blank.docx - Word"); var fileNoteButton = new WinButton(templatesToolbar); fileNoteButton.SearchProperties[WinButton.PropertyNames.Name] = "BCC FileNotes"; fileNoteButton.WindowTitles.Add("Blank.docx - Word"); return fileNoteButton; }
/// <summary> /// Handles the dialog if the <paramref name="window" /> is a /// security alert dialog. /// </summary> /// <param name="window">The window.</param> /// <returns></returns> public override bool HandleDialog(Window window) { if (IsSecurityAlertDialog(window)) { NativeMethods.SetForegroundWindow(window.Hwnd); NativeMethods.SetActiveWindow(window.Hwnd); WinButton buttonOk = new WinButton(1, window.Hwnd); buttonOk.Click(); return true; } return false; }
/// <summary> /// CloseBrowser /// </summary> public void CloseBrowser() { #region Variable Declarations WinButton uICloseButton = this.UIBlankPageMicrosoftInWindow.UIBlankPageWindowsInteTitleBar.UICloseButton; #endregion // Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.) // Click 'Close' button // Mouse.Click(uICloseButton, new Point(31, 0)); Playback.PlaybackSettings.ContinueOnError = true; Keyboard.SendKeys(this.UIBlankPageMicrosoftInWindow, "{F4}", ModifierKeys.Alt); Playback.PlaybackSettings.ContinueOnError = false; // Reset flag to ensure that play back stops if there is an error. }
/// <summary>_ /// GetCustomerCode /// </summary> public string GetCustomerCode() { #region Variable Declarations WinButton uICancelButton = this.UIPolicyautotestWindow.UIPolicyListWindow.UICancelWindow.UICancelButton; WinEdit uIItemEdit = this.UIPolicyautotestWindow.UICUSTOMERSWindow.UIItemWindow.UIItemEdit; #endregion // Click 'Cancel' button // Mouse.Click(uICancelButton, new Point(42, 10)); return(uIItemEdit.GetProperty("Text").ToString()); // Click 'Unknown Name' text box //Mouse.Click(uIItemEdit, new Point(83, 7)); }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations HtmlHyperlink uIModelAirplanesHyperlink = this.UIBingInternetExplorerWindow.UIHomeTailspinToysDocument.UIModelAirplanesCustom.UIModelAirplanesHyperlink; WinButton uICloseButton = this.UIBingInternetExplorerWindow.UIHomeTailspinToysInteTitleBar.UICloseButton; #endregion // Go to web page 'http://tailspinpaasdeploy.azurewebsites.net/' using new browser instance this.UIBingInternetExplorerWindow.LaunchUrl(new System.Uri(this.RecordedMethod1Params.UIBingInternetExplorerWindowUrl)); // Click 'Model Airplanes' link Mouse.Click(uIModelAirplanesHyperlink, new Point(92, 22)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(33, 0)); }
/// <summary> /// RecordedMethod1 /// </summary> public void RecordedMethod1() { #region Variable Declarations WinControl uIGengAreyousureAlert = this.UICDocumentsandSettingWindow.UIFileCDocumentsandSetDocument.UITestCustom.UIItemClient.UIGengAreyousureAlert; WinButton uIButtonIvanButton = this.UICDocumentsandSettingWindow.UIFileCDocumentsandSetDocument.UITestCustom.UIItemClient.UIButtonIvanButton; #endregion // Click 'Geng, Are you sure?' Alert Mouse.Click(uIGengAreyousureAlert, new Point(79, 77)); // Click 'buttonIvan' button Mouse.Click(uIButtonIvanButton, new Point(30, 14)); // Click 'Geng, Are you sure?' Alert Mouse.Click(uIGengAreyousureAlert, new Point(88, 77)); }
/// <summary> /// Opens up the tip calculator, tests a bill cost of 20 and a tip percent of 20 and then computes the tip. /// </summary> public void TipCalculatorWalkthroughTest() { #region Variable Declarations WinEdit uIBillTotalInputEdit = this.UITipCalculatorWindow.UIBillTotalInputWindow.UIBillTotalInputEdit; WinButton uIComputeTipButton = this.UITipCalculatorWindow.UIComputeTipWindow.UIComputeTipButton; #endregion // Launch '%USERPROFILE%\Source\Repos\cs3500\Tip_Calculator\Tip_Calculator\bin\Debug\Tip_Calculator.exe' ApplicationUnderTest uITipCalculatorWindow = ApplicationUnderTest.Launch(this.TipCalculatorWalkthroughTestParams.UITipCalculatorWindowExePath, this.TipCalculatorWalkthroughTestParams.UITipCalculatorWindowAlternateExePath); // Type '20' in 'billTotalInput' text box uIBillTotalInputEdit.Text = this.TipCalculatorWalkthroughTestParams.UIBillTotalInputEditText; // Click 'Compute Tip' button Mouse.Click(uIComputeTipButton, new Point(55, 17)); }
/// <summary> /// TestCalculator - Use 'TestCalculatorParams' to pass parameters into this method. /// </summary> public void TestCalculator() { #region Variable Declarations WinEdit uINameEdit = this.UIDebugWindow.UIItemWindow.UISampleCalculatorexeListItem.UINameEdit; WpfEdit uITextBoxEdit = this.UIMainWindowWindow.UITextBoxEdit; WpfEdit uITextBox_CopyEdit = this.UIMainWindowWindow.UITextBox_CopyEdit; WpfComboBox uIComboBoxComboBox = this.UIMainWindowWindow.UIComboBoxComboBox; WpfButton uICalculateButton = this.UIMainWindowWindow.UICalculateButton; WinButton uICloseButton = this.UIMainWindowWindow1.UICloseButton; #endregion // Double-Click 'Name' text box Mouse.DoubleClick(uINameEdit, new Point(63, 19)); // Type '1' in 'textBox' text box uITextBoxEdit.Text = this.TestCalculatorParams.UITextBoxEditText; // Type '2' in 'textBox_Copy' text box uITextBox_CopyEdit.Text = this.TestCalculatorParams.UITextBox_CopyEditText; // Select 'Add' in 'comboBox' combo box uIComboBoxComboBox.SelectedItem = this.TestCalculatorParams.UIComboBoxComboBoxSelectedItem; // Click 'Calculate' button Mouse.Click(uICalculateButton, new Point(65, 7)); // Select 'Multiply' in 'comboBox' combo box uIComboBoxComboBox.SelectedItem = this.TestCalculatorParams.UIComboBoxComboBoxSelectedItem1; // Click 'Calculate' button Mouse.Click(uICalculateButton, new Point(59, 15)); // Select 'Divide' in 'comboBox' combo box uIComboBoxComboBox.SelectedItem = this.TestCalculatorParams.UIComboBoxComboBoxSelectedItem2; // Click 'Calculate' button Mouse.Click(uICalculateButton, new Point(64, 19)); // Select 'Substract' in 'comboBox' combo box uIComboBoxComboBox.SelectedItem = this.TestCalculatorParams.UIComboBoxComboBoxSelectedItem3; // Click 'Calculate' button Mouse.Click(uICalculateButton, new Point(63, 15)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(15, 18)); }
/// <summary> /// Provide_File_Name /// </summary> public void Provide_File_Name() { #region Variable Declarations HtmlSpan uIBrowsePane = this.UIHomeCivicClientPortaWindow.UIHomeCivicClientPortaDocument2.UIBrowsePane; WinEdit uINameEdit = this.UIChooseFiletoUploadWindow.UIItemWindow.UIExample32filefnmListItem.UINameEdit; WinButton uIOpenButton = this.UIChooseFiletoUploadWindow.UIOpenWindow.UIOpenButton; #endregion // Click 'Browse…' pane Mouse.Click(uIBrowsePane, new Point(49, 22)); // Click 'Name' text box Mouse.Click(uINameEdit, new Point(92, 15)); // Click '&Open' button Mouse.Click(uIOpenButton, new Point(55, 11)); }
/// <summary> /// ImportDefectParameters - Use 'ImportDefectParametersParams' to pass parameters into this method. /// </summary> public void ImportDefectParameters() { #region Variable Declarations WinButton uIImportButton = this.UISmartViewRecipeManagWindow.UIDefectParametersStatWindow.UIImportWindow.UIImportButton; WinComboBox uIFilenameComboBox = this.UIImportDefectParameteWindow.UIItemWindow.UIFilenameComboBox; WinButton uIOpenButton = this.UIImportDefectParameteWindow.UIOpenWindow.UIOpenButton; #endregion // Click 'Import...' button Mouse.Click(uIImportButton, new Point(34, 16)); // Select 'aa.txt' in 'File name:' combo box uIFilenameComboBox.EditableItem = this.ImportDefectParametersParams.UIFilenameComboBoxEditableItem; // Click '&Open' button Mouse.Click(uIOpenButton, new Point(50, 21)); }
/// <summary> /// ExportDefectParameters - Use 'ExportDefectParametersParams' to pass parameters into this method. /// </summary> public void ExportDefectParameters() { #region Variable Declarations WinButton uIExportButton = this.UISmartViewRecipeManagWindow.UIDefectParametersStatWindow.UIExportWindow.UIExportButton; WinComboBox uIFilenameComboBox = this.UIExportDefectParameteWindow.UIDetailsPanePane.UIFilenameComboBox; WinButton uISaveButton = this.UIExportDefectParameteWindow.UISaveWindow.UISaveButton; #endregion // Click 'Export...' button Mouse.Click(uIExportButton, new Point(56, 16)); // Select 'aa' in 'File name:' combo box uIFilenameComboBox.EditableItem = this.ExportDefectParametersParams.UIFilenameComboBoxEditableItem; // Click '&Save' button Mouse.Click(uISaveButton, new Point(41, 11)); }
/// <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> /// SiteClose /// </summary> public void SiteClose() { #region Variable Declarations WinButton uICloseButton = this.UIInsurEcomSystemMaintWindow.UIInsurEcomSystemMaintTitleBar.UICloseButton; #endregion // Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.) Playback.PlaybackSettings.ContinueOnError = true; // Click 'Close' button Mouse.Click(uICloseButton, new Point(28, 2)); // The recording for the application under test '\\Pc-pez\J-Drive\WINTAM\clntfile.exe' may not be correct as it is located on a network share. Please install the application on a local path. // Reset flag to ensure that play back stops if there is an error. Playback.PlaybackSettings.ContinueOnError = false; }
public void SearchInspectionDataByGivenLastPeriod(bool isSearchByStartDate) { #region Variable Declarations WinCheckBox uIStartdateCheckBox = this.UISmartViewDataSelectoWindow.UIStartdateWindow.UIStartdateClient.UIStartdateCheckBox; WinRadioButton uILastRadioButton = this.UISmartViewDataSelectoWindow.UILastWindow.UILastRadioButton; WinComboBox uICmbLastComboBox = this.UISmartViewDataSelectoWindow.UICmbLastWindow.UICmbLastComboBox; WinButton uISearchButton = this.UISmartViewDataSelectoWindow.UISearchWindow.UISearchButton; WinCheckBox uIMaxrecordsCheckBox = this.UISmartViewDataSelectoWindow.UIMaxrecordsWindow.UIMaxrecordsClient.UIMaxrecordsCheckBox; WinEdit uITxtMaxRecordsEdit = this.UISmartViewDataSelectoWindow.UIItem100Window.UITxtMaxRecordsEdit; WinListItem uITest11ListItem = this.UISmartViewDataSelectoWindow.UIListvwDataWindow.UITest11ListItem; WinButton uIOKButton = this.UISmartViewDataSelectoWindow.UIOKWindow.UIOKButton; #endregion // Select 'Start date' check box uIStartdateCheckBox.Checked = isSearchByStartDate; if (isSearchByStartDate) { // Click 'Last:' radio button Mouse.Click(uILastRadioButton, new Point(7, 13)); // Select 'days' in 'cmbLast' combo box uICmbLastComboBox.SelectedItem = "weeks"; if (uIMaxrecordsCheckBox.Checked) { // Select 'Max records:' check box uIMaxrecordsCheckBox.Checked = this.SearchInspectionDataByGivenLastPeriodParams.UIMaxrecordsCheckBoxChecked; } } // Type '1' in 'txtMaxRecords' text box // uITxtMaxRecordsEdit.Text = this.SearchInspectionDataByGivenLastPeriodParams.UITxtMaxRecordsEditText; // Click '&Search' button Mouse.Click(uISearchButton, new Point(67, 9)); // Click 'test-11' list item Mouse.Click(uITest11ListItem, new Point(160, 14)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(47, 11)); }
/// <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)); }
public void MotoMTABeforeAccept() { WinClient uIQuoteResultsClient = map.UIQuoteResultsWindow.UIItemWindow2.UIClient(); WinButton uIAcceptButton = map.UIQuoteResultsWindow.UIAcceptWindow.UIAcceptButton; Mouse.Click(uIQuoteResultsClient, new Point(10, 10)); Keyboard.SendKeys(uIQuoteResultsClient, CommonParams.SendHomeKeys, ModifierKeys.None); Mouse.Click(uIAcceptButton); EtamYes(); ConfirmDocuments(); this.EtamOk(true); }
/// <summary> /// ExportRepeatingDefectSetupParameter - Use 'ExportRepeatingDefectSetupParameterParams' to pass parameters into this method. /// </summary> public void ExportRepeatingDefectSetupParameter() { #region Variable Declarations WinButton uIExportButton = this.UISmartViewRecipeManagWindow.UIRepeatingDefectSetupWindow.UIExportWindow.UIExportButton; WinComboBox uIFilenameComboBox = this.UIExportRepeatingDefecWindow.UIDetailsPanePane.UIFilenameComboBox; WinButton uISaveButton = this.UIExportRepeatingDefecWindow.UISaveWindow.UISaveButton; #endregion // Click 'Export...' button Mouse.Click(uIExportButton, new Point(34, 12)); // Select 'test.txt' in 'File name:' combo box uIFilenameComboBox.EditableItem = this.ExportRepeatingDefectSetupParameterParams.UIFilenameComboBoxEditableItem; // Click '&Save' button Mouse.Click(uISaveButton, new Point(32, 17)); }
/// <summary> /// ExecuteWinApp - Use 'ExecuteWinAppParams' to pass parameters into this method. /// </summary> public void ExecuteWinApp() { #region Variable Declarations WinEdit uITextBox1Edit = this.UISSGSEMSWindow.UITextBox1Window.UITextBox1Edit; WinButton uIGetBasicDataButton = this.UISSGSEMSWindow.UIGetBasicDataWindow.UIGetBasicDataButton; WinButton uIGetExtendedDataButton = this.UISSGSEMSWindow.UIGetExtendedDataWindow.UIGetExtendedDataButton; #endregion // Type '1' in 'textBox1' text box uITextBox1Edit.Text = this.ExecuteWinAppParams.UITextBox1EditText; // Click 'Get Basic Data' button Mouse.Click(uIGetBasicDataButton, new Point(15, 15)); // Click 'Get Extended Data' button Mouse.Click(uIGetExtendedDataButton, new Point(15, 23)); }
/// <summary> /// ImportTileMapDefinition - Use 'ImportTileMapDefinitionParams' to pass parameters into this method. /// </summary> public void ImportTileMapDefinition() { #region Variable Declarations WinButton uIImportButton = this.UISmartViewRecipeManagWindow.UITileMapDefinitionStaWindow.UIImportWindow.UIImportButton; WinList uIListList = this.UIItemWindow1.UIListWindow.UIListList; WinButton uIOKButton = this.UIItemWindow1.UIOKWindow.UIOKButton; #endregion // Click 'Import...' button Mouse.Click(uIImportButton, new Point(62, 7)); // Select 'TileMapDefinition' in 'list' list box uIListList.SelectedItemsAsString = this.ImportTileMapDefinitionParams.UIListListSelectedItemsAsString; // Click 'OK' button Mouse.Click(uIOKButton, new Point(26, 10)); }
/// <summary> /// Log in user /// </summary> public void LogInTest() { #region Variable Declarations WinEdit uIUsernameEdit = this.UILogInMozillaFirefoxWindow.UILogInDocument.UIUsernameEdit; WinEdit uIPasswordEdit = this.UILogInMozillaFirefoxWindow.UILogInDocument.UIPasswordEdit; WinButton uILOGINButton = this.UILogInMozillaFirefoxWindow.UILogInDocument.UILOGINButton; #endregion // Type 'krzesimir' in 'Username:'******'********' in 'Password:'******'LOG IN' button Mouse.Click(uILOGINButton, new Point(102, 10)); }
/// <summary> /// Проверка вычитания /// </summary> public void ResultSubstractRecordedMethod() { #region Variable Declarations WinEdit uIValueOneTextBoxEdit = this.UICalcWindow.UIValueOneTextBoxWindow.UIValueOneTextBoxEdit; WinEdit uIValueTwoTextBoxEdit = this.UICalcWindow.UIValueTwoTextBoxWindow.UIValueTwoTextBoxEdit; WinButton uIItemButton = this.UICalcWindow.UIItemWindow1.UIItemButton; #endregion // Тип "40" в "valueOneTextBox" надпись uIValueOneTextBoxEdit.Text = this.ResultSubstractRecordedMethodParams.UIValueOneTextBoxEditText; // Тип "23" в "valueTwoTextBox" надпись uIValueTwoTextBoxEdit.Text = this.ResultSubstractRecordedMethodParams.UIValueTwoTextBoxEditText; // Щелкните "-" кнопка Mouse.Click(uIItemButton, new Point(25, 18)); }
/// <summary> /// ChangeToSharedSelection /// </summary> public void ChangeToSharedSelection() { #region Variable Declarations WinTitleBar uITrendViewerTitleBar = this.UISmartViewProductionQWindow.UITrendViewerWindow.UITrendViewerTitleBar; WinMenuItem uIItemMenuItem = this.UIItemWindow.UIContextMenu.UIItemMenuItem; WinButton uIItemButton = this.UISmartViewProductionQWindow.UITrendViewerWindow.UIToolbarWindow.UIItemButton; #endregion // Click 'Trend Viewer' title bar Mouse.Click(uITrendViewerTitleBar, new Point(466, 11)); // Click 'Unknown Name' menu item Mouse.Click(uIItemMenuItem, new Point(30, 8)); // Click button numbered 4 in 'toolbar' window Mouse.Click(uIItemButton, new Point(15, 13)); }
/// <summary> /// Print /// </summary> public void PrintRecord() { #region Variable Declarations WinText uIPrintText = this.UIBtnPrintWindow.UIPrintWindow.UIPrintText; WinWindow uIPrintpreviewWindow = this.UIPrintpreviewWindow; WinButton uICloseButton = this.UIPrintpreviewWindow.UIPrintpreviewTitleBar.UICloseButton; #endregion // Click 'Print' label Mouse.Click(uIPrintText, new Point(29, 28)); // Maximize window 'Print preview' uIPrintpreviewWindow.Maximized = this.PrintRecordParams.UIPrintpreviewWindowMaximized; // Click 'Close' button Mouse.Click(uICloseButton, new Point(40, 13)); }
/// <summary> /// Cleanup /// </summary> public void Cleanup() { #region Variable Declarations WpfButton uIHauptmenuButton = this.UIMainWindowWindow.UIItemCustom.UIHauptmenuButton; WpfListItem uISystemDynamicExpandoListItem1 = this.UIMainWindowWindow.UILb_vermietungList.UISystemDynamicExpandoListItem1; WinButton uISchließenButton = this.UIMainWindowWindow1.UISchließenButton; #endregion // Klicken "Hauptmenu" Schaltfläche Mouse.Click(uIHauptmenuButton, new Point(331, 10)); // Klicken "System.Dynamic.ExpandoObject" Listenelement Mouse.Click(uISystemDynamicExpandoListItem1, new Point(317, 6)); // Klicken "Schließen" Schaltfläche Mouse.Click(uISchließenButton, new Point(28, 23)); }
/// <summary> /// RecordedMethod2 /// </summary> public void RecordedMethod2() { #region Variable Declarations WinMenuItem uIFileMenuItem = this.UIYexcelWindow.UIMenuStrip1MenuBar.UIFileMenuItem; WinMenuItem uICloseMenuItem = this.UIYexcelWindow.UIMenuStrip1MenuBar.UIFileMenuItem.UICloseMenuItem; WinButton uINOButton = this.UIClosingWindow.UINOWindow.UINOButton; #endregion // Click 'File' menu item Mouse.Click(uIFileMenuItem, new Point(23, 13)); // Click 'File' -> 'Close' menu item Mouse.Click(uICloseMenuItem, new Point(58, 6)); // Click '&No' button Mouse.Click(uINOButton, new Point(56, 17)); }
/// <summary> /// /// </summary> public void Select_NoToAll() { Thread.Sleep(500); WndImagePro image = new WndImagePro(); WinWindow wnd = new WinWindow(image); wnd.SearchProperties.Add(new PropertyExpression(WinControl.PropertyNames.Name, "Image-Pro", PropertyExpressionOperator.EqualTo)); wnd.SearchProperties.Add(new PropertyExpression(WinControl.PropertyNames.ControlName, "CloseAllForm", PropertyExpressionOperator.EqualTo)); if (wnd.Exists) { WinButton client = new WinButton(wnd); client.SearchProperties.Add(new PropertyExpression(UITestControl.PropertyNames.Name, "No to All", PropertyExpressionOperator.EqualTo)); client.Click(); } }
/// <summary> /// ImportRepeatingDefectDetectionSetupParameters - Use 'ImportRepeatingDefectDetectionSetupParametersParams' to pass parameters into this method. /// </summary> public void ImportRepeatingDefectDetectionSetupParameters() { #region Variable Declarations WinButton uIImportButton = this.UISmartViewRecipeManagWindow.UIRepeatingDefectSetupWindow.UIImportWindow.UIImportButton; WinComboBox uIFilenameComboBox = this.UIImportRepeatingDefecWindow.UIItemWindow.UIFilenameComboBox; WinButton uIOpenButton = this.UIImportRepeatingDefecWindow.UIOpenWindow.UIOpenButton; #endregion // Click 'Import...' button Mouse.Click(uIImportButton, new Point(27, 15)); // Select 'test.txt' in 'File name:' combo box uIFilenameComboBox.EditableItem = this.ImportRepeatingDefectDetectionSetupParametersParams.UIFilenameComboBoxEditableItem; // Click '&Open' button Mouse.Click(uIOpenButton, new Point(39, 16)); }
/// <summary> /// SaveClassifier - Use 'SaveClassifierParams' to pass parameters into this method. /// </summary> public void SaveClassifier(String name) { #region Variable Declarations WinMenuItem uISaveAsMenuItem = this.UISmartLearnClassifierWindow.UIMainFormMenuBar.UIFileMenuItem.UISaveAsMenuItem; WinEdit uITextNameEdit = this.UISaveClassifierWindow.UITextNameWindow.UITextNameEdit; WinButton uISaveButton = this.UISaveClassifierWindow.UISaveWindow.UISaveButton; #endregion // Click 'File' -> 'Save As...' menu item Mouse.Click(uISaveAsMenuItem, new Point(69, 12)); // Type 'Automation' in 'textName' text box uITextNameEdit.Text = name; // Click 'Save' button Mouse.Click(uISaveButton, new Point(45, 20)); }
/// <summary> /// ImportThresholds - Use 'ImportThresholdsParams' to pass parameters into this method. /// </summary> public void ImportThresholds(String fileName) { #region Variable Declarations WinButton uIImportButton = this.UISmartViewRecipeManagWindow.UIThresholdsStationVieWindow.UIImportWindow.UIImportButton; WinComboBox uIFilenameComboBox = this.UIImportThresholdSettiWindow.UIItemWindow.UIFilenameComboBox; WinSplitButton uIOpenSplitButton = this.UIImportThresholdSettiWindow.UIOpenWindow.UIOpenSplitButton; #endregion // Click 'Import...' button Mouse.Click(uIImportButton, new Point(45, 15)); // Select 'AlternateThresholds-AtEdges.txt' in 'File name:' combo box uIFilenameComboBox.EditableItem = fileName; // Click '&Open' split button Mouse.Click(uIOpenSplitButton, new Point(50, 11)); }
/// <summary> /// player disconnects after player enters name /// </summary> public void prematureDisconnect() { #region Variable Declarations WpfButton uISubmitButton = this.UIBoggleWindow.UISubmitButton; WpfEdit uIInputEdit = this.UIBoggleWindow.UIInputEdit; WpfButton uICloseButton = this.UIBoggleWindow.UIBoggleTitleBar.UICloseButton; WinButton uICloseButton1 = this.UILauncherexeShortcutWindow.UILauncherexeShortcutTitleBar.UICloseButton; #endregion // Launch '%VisualStudioDir%\Projects\PS9\Launcher\bin\Debug\Launcher.exe' ApplicationUnderTest launcherApplication = ApplicationUnderTest.Launch(this.prematureDisconnectParams.ExePath, this.prematureDisconnectParams.AlternateExePath); // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(23, 5)); // Type 'ferd' in 'Input' text box uIInputEdit.Text = this.prematureDisconnectParams.UIInputEditText; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(28, 0)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(28, 18)); // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(27, 10)); // Type 'derp' in 'Input' text box uIInputEdit.Text = this.prematureDisconnectParams.UIInputEditText1; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(13, 10)); // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(22, 18)); // Type 'derp' in 'Input' text box uIInputEdit.Text = this.prematureDisconnectParams.UIInputEditText2; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(22, 18)); // Click 'Close' button Mouse.Click(uICloseButton1, new Point(42, 9)); }
/// <summary> /// SaveDataFilter - Use 'SaveDataFilterParams' to pass parameters into this method. /// </summary> public void CreateDataFilter(String dataFilter) { #region Variable Declarations WinTitleBar uIInspectionSummaryTitleBar = this.UISmartViewProductionQWindow.UIInspectionSummaryWindow.UIInspectionSummaryTitleBar; WinButton uIWizardButton = this.UISmartViewProductionQWindow.UIInspectionSummaryWindow.UIToolBarPreviewWindow.UIWizardButton; WinCheckBox uIDefectclassesCheckBox = this.UIInspectionSummaryWindow.UIDefectclassesWindow.UIDefectclassesClient.UIDefectclassesCheckBox; WinRadioButton uISeverityRadioButton = this.UIInspectionSummaryWindow.UISeverityWindow.UISeverityRadioButton; WinEdit uITxtClassesSeverityEdit = this.UIInspectionSummaryWindow.UIItem0Window.UITxtClassesSeverityEdit; WinButton uIPreviewButton = this.UIInspectionSummaryWindow.UIPreviewWindow.UIPreviewButton; WinButton uIBtnSaveButton = this.UIInspectionSummaryWindow.UIBtnSaveWindow.UIBtnSaveButton; WinEdit uITextEdit = this.UISaveWindow.UITextWindow.UITextEdit; WinButton uIOKButton = this.UISaveWindow.UIOKWindow.UIOKButton; WinButton uIFinishButton = this.UIInspectionSummaryWindow.UIFinishWindow.UIFinishButton; #endregion // Click 'Inspection Summary' title bar Mouse.Click(uIInspectionSummaryTitleBar, new Point(554, 9)); // Click 'Wizard' button Mouse.Click(uIWizardButton, new Point(11, 16)); // Select 'Defect classes' check box uIDefectclassesCheckBox.Checked = this.SaveDataFilterParams.UIDefectclassesCheckBoxChecked; // Select 'Severity' radio button uISeverityRadioButton.Selected = this.SaveDataFilterParams.UISeverityRadioButtonSelected; // Type '2' in 'txtClassesSeverity' text box uITxtClassesSeverityEdit.Text = this.SaveDataFilterParams.UITxtClassesSeverityEditText; // Click 'Preview' button Mouse.Click(uIPreviewButton, new Point(34, 16)); // Click 'btnSave' button Mouse.Click(uIBtnSaveButton, new Point(9, 13)); // Type 'AtmSeverity' in 'text' text box uITextEdit.Text = dataFilter; // Click 'OK' button Mouse.Click(uIOKButton, new Point(29, 10)); // Click 'Finish' button Mouse.Click(uIFinishButton, new Point(29, 7)); }
/// <summary> /// TypeComplicatedRealExpressionAndMake2DChart - Use 'TypeComplicatedRealExpressionAndMake2DChartParams' to pass parameters into this method. /// </summary> public void TypeComplicatedRealExpressionAndMake2DChart() { #region Variable Declarations WinEdit uIExpressionTextBoxEdit = this.UIComputatorNETPawelTrWindow.UIExpressionTextBoxWindow.UIExpressionTextBoxEdit; WinControl uIXaxisMajorGridlinesImage = this.UIComputatorNETPawelTrWindow.UIChartAreaChartArea1Image.UIXaxisMajorGridlinesImage; WinButton uIClearchartButton = this.UIComputatorNETPawelTrWindow.UIClearchartWindow.UIClearchartButton; WinButton uICloseButton = this.UIComputatorNETPawelTrWindow.UIComputatorNETPawelTrTitleBar.UICloseButton; #endregion // Type '2·xˣ+x·sin(x)' in 'expressionTextBox' text box uIExpressionTextBoxEdit.Text = this.TypeComplicatedRealExpressionAndMake2DChartParams.UIExpressionTextBoxEditText; // Type '{Enter}' in 'expressionTextBox' text box Keyboard.SendKeys(uIExpressionTextBoxEdit, this.TypeComplicatedRealExpressionAndMake2DChartParams.UIExpressionTextBoxEditSendKeys, ModifierKeys.None); // Move using Right button 'X axis Major Gridlines' image Mouse.StartDragging(uIXaxisMajorGridlinesImage, new Point(239, 133), MouseButtons.Right, ModifierKeys.None); Mouse.StopDragging(uIXaxisMajorGridlinesImage, 51, 7); // Move using Right button 'X axis Major Gridlines' image Mouse.StartDragging(uIXaxisMajorGridlinesImage, new Point(276, 109), MouseButtons.Right, ModifierKeys.None); Mouse.StopDragging(uIXaxisMajorGridlinesImage, -9, -4); // Move using Right button 'X axis Major Gridlines' image Mouse.StartDragging(uIXaxisMajorGridlinesImage, new Point(274, 134), MouseButtons.Right, ModifierKeys.None); Mouse.StopDragging(uIXaxisMajorGridlinesImage, -24, -1); // Move using Right button 'X axis Major Gridlines' image Mouse.StartDragging(uIXaxisMajorGridlinesImage, new Point(254, 125), MouseButtons.Right, ModifierKeys.None); Mouse.StopDragging(uIXaxisMajorGridlinesImage, -18, -26); // Move using Right button 'X axis Major Gridlines' image Mouse.StartDragging(uIXaxisMajorGridlinesImage, new Point(220, 86), MouseButtons.Right, ModifierKeys.None); Mouse.StopDragging(uIXaxisMajorGridlinesImage, -22, 118); // Move using Right button 'X axis Major Gridlines' image Mouse.StartDragging(uIXaxisMajorGridlinesImage, new Point(198, 195), MouseButtons.Right, ModifierKeys.None); Mouse.StopDragging(uIXaxisMajorGridlinesImage, 26, 1); // Click 'Clear chart' button Mouse.Click(uIClearchartButton, new Point(29, 20)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(23, 12)); }
// Example: // new List<string> { "Film Hire", "Film Hire Payments" } it will open Film Hire folder, // and then Film Hire Payments inside of this folder public static void NavigateTo(List<string> folders) { var collapseAll = new WinButton(WindowVistaApplication()); collapseAll.SearchProperties[UITestControl.PropertyNames.Name] = "Collapse All"; Mouse.Click(collapseAll); // This value shows tree level var searchPropertiesValue = 0; foreach (var nameOfFolder in folders) { var treeLevel = new WinTreeItem(WindowFolderTree()); treeLevel.SearchProperties[UITestControl.PropertyNames.Name] = nameOfFolder; treeLevel.SearchProperties["Value"] = searchPropertiesValue.ToString(); Mouse.DoubleClick(treeLevel); searchPropertiesValue = Convert.ToInt32(searchPropertiesValue) + 1; } }
/// <summary> /// Handles the File upload dialog. /// </summary> /// <param name="window">The window.</param> /// <returns></returns> public override bool HandleDialog(Window window) { if (CanHandleDialog(window)) { var fileNameHandle = NativeMethods.GetChildWindowHwnd(window.Hwnd, "Edit"); var fileNameHwnd = new Hwnd(fileNameHandle); fileNameHwnd.SetFocus(); fileNameHwnd.SendString(fileName); var openButton = new WinButton(1, window.Hwnd); openButton.Click(); return true; } return false; }
public static void ClickWinButton(string wintitle, string tabname) { WinWindow wnd2 = new WinWindow(); wnd2.SearchProperties.Add(WinWindow.PropertyNames.Name, wintitle, PropertyExpressionOperator.Contains); wnd2.SearchProperties.Add(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains); wnd2.SetFocus(); wnd2.Maximized = true; Console.WriteLine("got focus of window"+ wnd2.Name); Console.WriteLine("Button Name " + tabname); WinButton wbtn = new WinButton(wnd2); UITestControlCollection allbtns = wbtn.FindMatchingControls(); Console.WriteLine("buttons count insiode widnows was " + allbtns.Count); foreach (UITestControl indbutton in allbtns) { Console.WriteLine("Found button " + indbutton.Name); } wbtn.SearchProperties.Add(WinButton.PropertyNames.Name, tabname, PropertyExpressionOperator.Contains); Mouse.Click(wbtn); }
/// <summary> /// Handles the dialog if the <paramref name="window" /> is a /// security alert dialog. /// </summary> /// <param name="window">The window.</param> /// <returns></returns> public override bool HandleDialog(Window window) { if (CanHandleDialog(window)) { NativeMethods.SetForegroundWindow(window.Hwnd); NativeMethods.SetActiveWindow(window.Hwnd); var buttonOk = new WinButton(1, window.Hwnd); if (buttonOk.Exists()) buttonOk.Click(); else { var buttonYes = new WinButton(6, window.Hwnd); buttonYes.Click(); } return true; } return false; }
public static void OptionalClickWindowButton(string windowtitle, string buttontext) { WinWindow addposn = new WinWindow(); addposn.SearchProperties.Add(WinWindow.PropertyNames.Name, windowtitle, PropertyExpressionOperator.Contains); LogtoFile("Searcing for Dialog Object "); string opwait = ConfigurationManager.AppSettings["optionalwait"]; int dwait = Int32.Parse(opwait); UITestControl windlg = new UITestControl(addposn); //for (int i = 0; i < 6; i++) //{ Playback.Wait(dwait); LogtoFile("Attempt....... #"); windlg.TechnologyName = "MSAA"; windlg.SearchProperties.Add("ControlType", "Dialog"); windlg.SearchProperties.Add("Name", "Load Update Wizard"); Playback.Wait(1000); //if (windlg.Exists) //{ // break; //} //} if (windlg.Exists) { WinButton addposbtn = new WinButton(windlg); addposbtn.SearchProperties.Add(WinButton.PropertyNames.Name, buttontext); if (addposbtn.Exists) { Mouse.Click(addposbtn); } } else { LogtoFile("Did not find the Dialog Object dialog in Max number of Attemps for button Text "+buttontext); } }
public void CalculateTax() { ApplicationUnderTest WinFormsApp = ApplicationUnderTest.Launch(@"C:\tmp\PUWindows\PartsUnlimited.Windows.exe"); WinComboBox shopSelection = new WinComboBox(WinFormsApp); shopSelection.SearchProperties.Add(WinControl.PropertyNames.Name, "cmbStores"); shopSelection.SelectedItem = "Store9"; WinButton Logon = new WinButton(WinFormsApp); Logon.SearchProperties.Add(WinControl.PropertyNames.Name, "btnLogin"); Mouse.Click(Logon); UIMap map = new UIMap(); Mouse.Click( map.UIPartsUnlimitedStoreAWindow.UIMenuStrip1MenuBar.UIReportsToolstripMenuMenuItem); WinMenuItem taxcalculation = new WinMenuItem(map.UIPartsUnlimitedStoreAWindow.UIMenuStrip1MenuBar.UIReportsToolstripMenuMenuItem); taxcalculation.SearchProperties.Add(WinControl.PropertyNames.Name, "calculateTax"); Mouse.Click(taxcalculation); var text = map.UICalculatedtax0Window.UICalculatedtax0Text.DisplayText; Assert.IsTrue(text.Contains("0")); }
protected static bool ButtonWithId1Exists(IntPtr windowHwnd) { var button = new WinButton(1, windowHwnd); return button.Exists(); }
public WinButton OKWarningButton() { WinWindow MessWin = new WinWindow(); MessWin.SearchProperties[WinWindow.PropertyNames.Name] = "LOWIS Warning Message"; MessWin.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32770"; MessWin.WindowTitles.Add("LOWIS Warning Message"); WinWindow OKButWin = new WinWindow(MessWin); OKButWin.SearchProperties[WinWindow.PropertyNames.ControlId] = "2"; OKButWin.WindowTitles.Add("LOWIS Warning Message"); WinButton OkWarningButton = new WinButton(OKButWin); OkWarningButton.SearchProperties[WinButton.PropertyNames.Name] = "OK"; OkWarningButton.WindowTitles.Add("LOWIS Warning Message"); return OkWarningButton; }
public static void CloseWindow(string name) { WinWindow window = new WinWindow(); window.SearchProperties[WinWindow.PropertyNames.Name] = name; window.WindowTitles.Add(name); WinTitleBar bar = new WinTitleBar(window); WinButton button = new WinButton(bar); button.SearchProperties[WinButton.PropertyNames.Name] = "關閉"; Mouse.Click(button); }
private static WinButton ButtonSave() { var saveButton = new WinButton(CommonUiMap.WindowMaintance()); saveButton.SearchProperties[UITestControl.PropertyNames.Name] = "Save"; return saveButton; }
public static void AssertOtherFormButtonEnable(string formName, string buttonName, bool assertValue) { WinWindow window = new WinWindow(); window.SearchProperties[WinWindow.PropertyNames.Name] = formName; window.WindowTitles.Add(formName); WinButton button = new WinButton(window); button.SearchProperties[WinWindow.PropertyNames.Name] = buttonName; Assert.AreEqual(button.Enabled, assertValue); }
public static void ClickOtherFormDoubleButton(string formName, string buttonName) { WinWindow window = new WinWindow(); window.SearchProperties[WinWindow.PropertyNames.Name] = formName; window.WindowTitles.Add(formName); WinButton button = new WinButton(window); button.SearchProperties[WinWindow.PropertyNames.Name] = buttonName; Mouse.Click(button); Mouse.Click(button); }
public string SaveWordDoco() { //WinButton FileButton = new WinButton(); //FileButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); //FileButton.SearchProperties[WinButton.PropertyNames.Name] = "File Tab"; //Mouse.DoubleClick(FileButton); WinWindow SaveAs = new WinWindow(); SaveAs.SearchProperties[WinWindow.PropertyNames.Name] = "Save As"; SaveAs.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32770"; SaveAs.WindowTitles.Add("Save As"); WinWindow ItemWin = new WinWindow(SaveAs); ItemWin.SearchProperties[WinWindow.PropertyNames.ClassName] = "ToolbarWindow32"; ItemWin.SearchProperties[WinWindow.PropertyNames.Instance] = "5"; ItemWin.WindowTitles.Add("Save As"); WinToolBar Toolbar = new WinToolBar(ItemWin); Toolbar.WindowTitles.Add("Save As"); WinButton PreviousLocations = new WinButton(Toolbar); PreviousLocations.SearchProperties[WinButton.PropertyNames.Name] = "Previous Locations"; PreviousLocations.WindowTitles.Add("Save As"); System.Threading.Thread.Sleep(2000); Mouse.Click(PreviousLocations); WinWindow ItemWin1 = new WinWindow(SaveAs); ItemWin1.SearchProperties[WinWindow.PropertyNames.ControlId] = "41477"; ItemWin1.SearchProperties[WinWindow.PropertyNames.Instance] = "4"; ItemWin1.WindowTitles.Add("Save As"); WinEdit AddressBar = new WinEdit(ItemWin1); AddressBar.SearchProperties[WinEdit.PropertyNames.Name] = "Address"; AddressBar.WindowTitles.Add("Save As"); AddressBar.Text = ExportLocation ; Keyboard.SendKeys("{ENTER}"); WinEdit FileName = new WinEdit(SaveAs); FileName.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); FileName.SearchProperties.Add(WinEdit.PropertyNames.Name, "File name:"); FileName.Text = BeamAnalysisWord; WinWindow SaveWindow = new WinWindow(SaveAs); SaveWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "1"; SaveWindow.WindowTitles.Add("Save As"); WinButton SaveButton = new WinButton(SaveWindow); SaveButton.SearchProperties[WinButton.PropertyNames.Name] = "Save"; SaveButton.WindowTitles.Add("Save As"); Thread.Sleep(2000); Mouse.Click(SaveButton); return (ExportLocation + BeamAnalysisWord); }
private static WinButton ButtonCalculateFilmHire() { var calculateFilmHireButton = new WinButton(WindowFilmHire()); calculateFilmHireButton.SearchProperties[UITestControl.PropertyNames.Name] = "Calculate Film Hire"; return calculateFilmHireButton; }
public UITestControl SearchWellWinControls(string ControlName) { WinWindow SearchWellWin = new WinWindow(); SearchWellWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); SearchWellWin.SearchProperties.Add(WinWindow.PropertyNames.ClassName, "#32770"); SearchWellWin.SearchProperties.Add(WinWindow.PropertyNames.Name, "Search Well"); WinWindow SearchWellWinEdit = new WinWindow(SearchWellWin); SearchWellWinEdit.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); SearchWellWinEdit.SearchProperties.Add(WinWindow.PropertyNames.ControlId, "1007"); WinWindow OKButtonWindow = new WinWindow(SearchWellWin); OKButtonWindow.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); OKButtonWindow.SearchProperties.Add(WinWindow.PropertyNames.ControlId, "1"); //IEnumerable<WinButton> Test = OKButtonWindow.GetChildren().OfType<WinButton>(); UITestControl ReturnThis = new UITestControl(); switch (ControlName) { case "SearchTxtBox": { ReturnThis = SearchWellWinEdit.GetChildren().OfType<WinEdit>().First(); break; } case "OKButton": { WinButton OKButton = new WinButton(OKButtonWindow); OKButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); OKButton.SearchProperties.Add(WinWindow.PropertyNames.Name, "OK"); ReturnThis = OKButton; break; } } return ReturnThis; }
public WinButton SplitterButton() { WinWindow ItemWindow = new WinWindow(GetMainWindow()); ItemWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "1010"; ItemWindow.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); WinButton SplitBut = new WinButton(ItemWindow); // AnalysisRunButton.SearchProperties[WinButton.PropertyNames.Name] = "Run Analysis on Selected Card"; SplitBut.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); ; return SplitBut; }
public WinButton GetAnalysisWorkflowButton() { WinWindow AnalysisWorkflowWin = new WinWindow(GetMainWindow()); AnalysisWorkflowWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); AnalysisWorkflowWin.SearchProperties.Add(WinWindow.PropertyNames.ControlName, "Analysis"); AnalysisWorkflowWin.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); WinButton AnalysisWorkflowButton = new WinButton(AnalysisWorkflowWin); AnalysisWorkflowButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); AnalysisWorkflowButton.SearchProperties.Add(WinButton.PropertyNames.Name, "Analysis"); AnalysisWorkflowButton.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); return AnalysisWorkflowButton; }
public WinButton GetRunAnalysisButton() { WinWindow ItemWindow = new WinWindow(GetMainWindow()); ItemWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "59392"; ItemWindow.SearchProperties[WinWindow.PropertyNames.Instance] = "3"; ItemWindow.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); WinButton AnalysisRunButton = new WinButton(ItemWindow); AnalysisRunButton.SearchProperties[WinButton.PropertyNames.Name] = "Run Analysis on Selected Card"; AnalysisRunButton.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString()));; return AnalysisRunButton; }
public WinButton MoveButtonToClick(string Name) { WinWindow ItemWindow = new WinWindow(GetMainWindow()); ItemWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = "1"; ItemWindow.SearchProperties[WinWindow.PropertyNames.Instance] = "2"; ItemWindow.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); WinButton ButtonToClick = new WinButton(); switch (Name) { case "Less": { WinButton LessButton = new WinButton(ItemWindow); LessButton.SearchProperties[WinButton.PropertyNames.Name] = "Less"; LessButton.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); ButtonToClick = LessButton; break; } case "More": { WinButton MoreButton = new WinButton(ItemWindow); MoreButton.SearchProperties[WinButton.PropertyNames.Name] = "More"; MoreButton.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); ; ButtonToClick = MoreButton; break; } } return ButtonToClick; }