/// <summary> /// DeleteCreatedCustomReport /// </summary> public void DeleteCustomReport(String customReportName) { #region Variable Declarations WinButton uIReportsButton = this.UISmartViewProductionQWindow.UIToolbarMainWindow.UIReportsButton; WinTabPage uICustomTabPage = this.UIReportBrowserWindow.UITabReportWindow.UICustomTabPage; WinListItem cutomReport = this.UIReportBrowserWindow.UIListSettingsWindow.UICustomReport12581859ListItem; WinMenuItem uIDeleteMenuItem = this.UIItemWindow.UIContextMenu.UIDeleteMenuItem; WinButton uIYesButton = this.UIConfirmationWindow.UIYesWindow.UIYesButton; WinButton uIOKButton = this.UIProductionQualityAdvWindow.UIOKWindow.UIOKButton; #endregion cutomReport.SearchProperties[WinListItem.PropertyNames.Name] = customReportName; cutomReport.WindowTitles.Add("Report Browser"); // Click 'Reports' button Mouse.Click(uIReportsButton, new Point(7, 10)); // Double-Click 'Custom' tab Mouse.DoubleClick(uICustomTabPage, new Point(16, 10)); // Right-Click 'CustomReport12581859791698347552589521771166024185...' list item Mouse.Click(cutomReport, MouseButtons.Right, ModifierKeys.None, new Point(81, 7)); // Click 'Delete' menu item Mouse.Click(uIDeleteMenuItem, new Point(35, 11)); // Click '&Yes' button Mouse.Click(uIYesButton, new Point(42, 9)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(43, 13)); }
/// <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)); }
private static WinTabPage GetWinTabPage(string uiTitle, string uiType) { var htmlcontrolWin = new WinTabPage(Window.Locate(uiTitle, uiType)); var htmlControlWin = htmlcontrolWin; htmlControlWin.TechnologyName = TechnologyNameWin; return(htmlControlWin); }
/// <summary> /// LoadInspectionReportTab /// </summary> public void LoadInspectionReportTab() { #region Variable Declarations WinTabPage uIInspectionReportsTabPage = this.UISmartViewRecipeManagWindow.UIReportandExportSetupWindow.UIItemWindow.UIItemTabList.UIInspectionReportsTabPage; #endregion // Click 'Inspection Reports' tab Mouse.Click(uIInspectionReportsTabPage, new Point(31, 12)); }
/// <summary> /// LoadCustomReportTabInReportBrowser /// </summary> public void LoadCustomReportTabInReportBrowser() { #region Variable Declarations WinTabPage uICustomTabPage = this.UIReportBrowserWindow.UITabReportWindow.UICustomTabPage; #endregion // Click 'Custom' tab Mouse.Click(uICustomTabPage, new Point(20, 10)); }
/// <summary> /// ClickSupportedEvents /// </summary> public void ClickParsingResults() { #region Variable Declarations WinTabPage uIParsingResultsTabPage = this.UIONVIFClientTestToolWindow.UITabControlWindow.UIParsingResultsTabPage; #endregion // Click 'Parsing Results' tab Mouse.Click(uIParsingResultsTabPage, new Point(38, 6)); }
/// <summary> /// NightDepositTab /// </summary> public void NightDepositTab() { #region Variable Declarations WinTabPage uINightdepositTabPage = this.UICommercialDepositDesWindow.UIItemWindow.UINightdepositTabPage; #endregion // Click 'Night deposit' tab Mouse.Click(uINightdepositTabPage, new Point(47, 13)); }
/// <summary> /// LoadSectionFormattingTab /// </summary> public void LoadSectionFormattingTab() { #region Variable Declarations WinTabPage uISectionFormattingTabPage = this.UILaneSummaryWindow.UITabWindow.UISectionFormattingTabPage; #endregion // Click 'Section Formatting' tab Mouse.Click(uISectionFormattingTabPage, new Point(41, 9)); }
/// <summary> /// LoadStandardReportTabInReportBrowser /// </summary> public void LoadStandardReportTabInReportBrowser() { #region Variable Declarations WinTabPage uIStandardTabPage = this.UIReportBrowserWindow.UITabReportWindow.UIStandardTabPage; #endregion // Click 'Standard' tab Mouse.Click(uIStandardTabPage, new Point(23, 8)); }
/// <summary> /// LoadClassListTab /// </summary> public void LoadClassListTab() { #region Variable Declarations WinTabPage uIClassListTabPage = this.UISmartLearnClassifierWindow.UITabsWindow.UIClassListTabPage; #endregion // Click 'Class List' tab Mouse.Click(uIClassListTabPage, new Point(75, 15)); }
/// <summary> /// LoadReportOptionsTab /// </summary> public void LoadReportOptionsTab() { #region Variable Declarations WinTabPage uIReportOptionsTabPage = this.UILaneSummaryWindow.UITabWindow.UIReportOptionsTabPage; #endregion // Click 'Report Options' tab Mouse.Click(uIReportOptionsTabPage, new Point(64, 8)); }
/// <summary> /// LoadReportOptionsTabInReportWizardWindow /// </summary> public void LoadReportOptionsTabInReportWizardWindow() { #region Variable Declarations WinTabPage uIReportOptionsTabPage = this.UIInspectionSummaryWindow.UITabWindow.UIReportOptionsTabPage; #endregion // Click 'Report Options' tab Mouse.Click(uIReportOptionsTabPage, new Point(28, 13)); }
/// <summary> /// ClickDeferredDepositTab /// </summary> public void ClickDeferredDepositTab() { #region Variable Declarations WinTabPage uIDeferreddepositTabPage = this.UICommercialDepositDesWindow.UIItemWindow.UIDeferreddepositTabPage; #endregion // Click 'Deferred deposit' tab Mouse.Click(uIDeferreddepositTabPage, new Point(48, 12)); System.Threading.Thread.Sleep(500); }
public static void SelectWinTab(string wintitle ,string tabname) { WinWindow wnd = new WinWindow(); wnd.SearchProperties.Add(WinWindow.PropertyNames.Name, wintitle, PropertyExpressionOperator.Contains); wnd.SearchProperties.Add(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains); wnd.SetFocus(); wnd.Maximized = true; WinTabPage wtbpg = new WinTabPage(wnd); wtbpg.SearchProperties.Add(WinTabPage.PropertyNames.Name, tabname, PropertyExpressionOperator.Contains); Mouse.Click(wtbpg); }
public static void SelectWinTab(string wintitle, string tabname) { WinWindow wnd = new WinWindow(); wnd.SearchProperties.Add(WinWindow.PropertyNames.Name, wintitle, PropertyExpressionOperator.Contains); wnd.SearchProperties.Add(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains); wnd.SetFocus(); wnd.Maximized = true; WinTabPage wtbpg = new WinTabPage(wnd); wtbpg.SearchProperties.Add(WinTabPage.PropertyNames.Name, tabname, PropertyExpressionOperator.Contains); Mouse.Click(wtbpg); }
/// <summary> /// LoadReportWizardWindow /// </summary> public void LoadReportWizardWindow() { #region Variable Declarations WinButton uIWizardButton = this.UISmartViewProductionQWindow.UIInspectionSummaryWindow.UIToolBarPreviewWindow.UIWizardButton; WinTabPage uIDefectFiltersTabPage = this.UIInspectionSummaryWindow.UITabWindow.UIDefectFiltersTabPage; #endregion // Click 'Wizard' button Mouse.Click(uIWizardButton, new Point(15, 13)); // Click 'Defect Filters' tab Mouse.Click(uIDefectFiltersTabPage, new Point(14, 13)); }
/// <summary> /// refresh /// </summary> public void refresh() { #region Variable Declarations WinTabPage uIHomeTabPage = this.UIUntitledPowerQueryEdWindow.UIItemWindow.UIRibbonClient.UIHomeTabPage; WinSplitButton uIRefreshPreviewSplitButton = this.UIUntitledPowerQueryEdWindow.UIItemWindow.UIRefreshPreviewGroup.UIRefreshPreviewSplitButton; #endregion // Click 'Home' tab Mouse.Click(uIHomeTabPage, new Point(34, 13)); // Click 'Refresh Preview' split button Mouse.Click(uIRefreshPreviewSplitButton, new Point(20, 22)); }
/// <summary> /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method. /// </summary> public void RecordedMethod1() { #region Variable Declarations WinButton uIZamknijButton = this.UIKreatoraktywacjiprodWindow.UIKreatoraktywacjiprodDialog.UIZamknijButton; WinTabPage uIWstawianieTabPage = this.UIDokument1MicrosoftWoWindow.UIItemWindow.UIRibbonClient.UIWstawianieTabPage; WinControl uITabelaDropDownGridButton = this.UIDokument1MicrosoftWoWindow.UIItemWindow.UITabeleToolBar.UITabelaDropDownGridButton; WinListItem uIItem3x1tabelaListItem = this.UIDokument1MicrosoftWoWindow.UIItemWindow.UIItem3x1tabelaGroup.UIItem3x1tabelaListItem; WinClient uIDokumentprogramuMicrClient = this.UIDokument1MicrosoftWoWindow.UIDokument1Client.UIDokumentprogramuMicrClient; WinTreeItem uIPulpitTreeItem = this.UIZapiszjakoWindow.UIWidokdrzewaWindow.UIPulpitTreeItem.UITenkomputerTreeItem.UIPulpitTreeItem; WinEdit uINazwaEdit = this.UIZapiszjakoWindow.UIItemWindow.UITestGuzikListItem.UINazwaEdit; WinEdit uINazwaEdit1 = this.UIZapiszjakoWindow.UIItemWindow1.UIWord3ListItem.UINazwaEdit; WinButton uIZapiszButton = this.UIZapiszjakoWindow.UIZapiszWindow.UIZapiszButton; WinButton uIZamknijButton1 = this.UIDokument1MicrosoftWoWindow.UIItemWindow.UIRibbonPropertyPage.UIZamknijButton; #endregion // Launch '%ProgramW6432%\Microsoft Office\Office14\WINWORD.EXE' ApplicationUnderTest wINWORDApplication = ApplicationUnderTest.Launch(this.RecordedMethod1Params.ExePath, this.RecordedMethod1Params.AlternateExePath); // Click 'Zamknij' button Mouse.Click(uIZamknijButton, new Point(27, 10)); // Click 'Wstawianie' tab Mouse.Click(uIWstawianieTabPage, new Point(29, 7)); // Click 'Tabela' DropDownGridButton Mouse.Click(uITabelaDropDownGridButton, new Point(19, 54)); // Click '3x1 — tabela' list item Mouse.Click(uIItem3x1tabelaListItem, new Point(10, 5)); // Click 'Dokument programu Microsoft Word' client Mouse.Click(uIDokumentprogramuMicrClient, new Point(513, 184)); // Type 'Control + s' in 'Dokument programu Microsoft Word' client Keyboard.SendKeys(uIDokumentprogramuMicrClient, this.RecordedMethod1Params.UIDokumentprogramuMicrClientSendKeys, ModifierKeys.Control); // Click 'Pulpit' -> 'Ten komputer' -> 'Pulpit' tree item Mouse.Click(uIPulpitTreeItem, new Point(30, 15)); // Double-Click 'Nazwa' text box Mouse.DoubleClick(uINazwaEdit, new Point(18, 14)); // Double-Click 'Nazwa' text box Mouse.DoubleClick(uINazwaEdit1, new Point(28, 8)); // Click '&Zapisz' button Mouse.Click(uIZapiszButton, new Point(45, 11)); // Click 'Zamknij' button Mouse.Click(uIZamknijButton1, new Point(47, 0)); }
public void CheckFeaturesExpectedResult() { this.treeName = "tVFeatures"; #region Variable Declarations WinComboBox uICBConversationsComboBox = this.UIONVIFClientTestToolWindow.UICBConversationsWindow.UICBConversationsComboBox; WinEdit uITBOutputEdit = this.UIONVIFClientTestToolWindow.UITBOutputWindow.UITBOutputEdit; WinTree uITVTestCasesTree = this.UIONVIFClientTestToolWindow.UITVTestCasesWindow.UITVTestCasesTree; WinTabPage uIFeaturesTabPage = this.UIONVIFClientTestToolWindow.UITCModesWindow.UIFeaturesTabPage; WinList uILVStepsList = this.UIONVIFClientTestToolWindow.UILVStepsWindow.UILVStepsList; #endregion if (test.featuresExpectedResult != null) { // Щелкните "Features" вкладка uIFeaturesTabPage.WaitForControlReady(); Mouse.Click(uIFeaturesTabPage); foreach (var featureExpectedResult in test.featuresExpectedResult) { mTree0 = featureExpectedResult.Key; this.mTreeItem = this.UIONVIFClientTestToolWindow.UITVTestCasesWindow.UIProfileSTestCasesTreeItem; //this.mTreeItem.(); mTreeItem.WaitForControlReady(); Mouse.Click(this.mTreeItem, new Point(0, 0)); Mouse.Hover(this.mTreeItem, new Point(this.mTreeItem.Width / 2, this.mTreeItem.Height / 2)); LogData logDataFeature = new LogData(); logDataFeature.testPath = testPath; logDataFeature.currentResult = featureExpectedResult.Key + " " + this.mTreeItem.ToolTipText; logDataFeature.expectedResult = featureExpectedResult.Key + " " + featureExpectedResult.Value; if (logDataFeature.currentResult == logDataFeature.expectedResult) { logDataFeature.result = "PASSED"; } else { logDataFeature.result = "FAILED"; } this.logDataFeatures.Add(logDataFeature); } } }
/// <summary> /// ClickSupportedEvents /// </summary> public void ClickSupportedEvents() { #region Variable Declarations WinTabPage uISupportedEventsTabPage = this.UIONVIFClientTestToolWindow.UITabControlWindow.UISupportedEventsTabPage; // WinTabPage uISupportedEventsTabPage = this.UIONVIFClientTestToolWindow.UITabControlWindow.UINetworkTraceCapturefTabList.UISupportedEventsTabPage; WinWindow uIОКWindow = this.UIWarningWindow.UIОКWindow; #endregion // Click 'Supported Events' tab if (uIОКWindow.Exists) { WinButton uIОКButton = this.UIWarningWindow.UIОКWindow.UIОКButton; // Щелкните "ОК" кнопка uIОКButton.WaitForControlReady(); Mouse.Click(uIОКButton); } Mouse.Click(uISupportedEventsTabPage, new Point(36, 7)); //Mouse.Click(uISupportedEventsTabPage, new Point(42, 10)); }
public void Login(string usernameParam, string passwordParam) { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // Find Dynamics AX Window WinWindow dynamicsAXWindow = new WinWindow(); dynamicsAXWindow.TechnologyName = "MSAA"; dynamicsAXWindow.SearchProperties.Add("Name", "Microsoft Dynamics AX", PropertyExpressionOperator.Contains); dynamicsAXWindow.SearchProperties.Add("ClassName", "AxMainFrame"); dynamicsAXWindow.WaitForControlExist(); mUIAXCWindow = dynamicsAXWindow; WinTabPage uITabPage = new WinTabPage(mUIAXCWindow); uITabPage.TechnologyName = "MSAA"; uITabPage.SearchProperties.Add("ControlType", "TabPage"); uITabPage.SearchProperties.Add("Name", "Home"); uITabPage.WaitForControlReady(); mUITabPage = uITabPage; mUITabPage.WaitForControlReady(); Mouse.Click(uITabPage, new Point(uITabPage.Width / 2, mUITabPage.Height / 2)); }
public void _OpenVPC(string sName, int iIndex = 1) { string sFunctionName = "_OpenVPC"; _gLib._Report(_PassFailStep.Step, "Function <" + sFunctionName + "> Starts:"); Boolean bServiceSelected = false; int ixPos = 60; int iyPos = 30; int iyStep = 20; for (int i = 1; i <= 6; i++) { _gLib._SetSyncUDWin("Home", this.wRetirementStudio.wTab.wHome, "Click", 0); _gLib._SetSyncUDWin("click service", this.wRetirementStudio.wVPCServicesManage.grid, "Click", 0, false, ixPos, iyPos + iyStep * (i - 1)); WinTabPage wTP = new WinTabPage(this.wRetirementStudio.wTab); wTP.SearchProperties.Add(WinTabPage.PropertyNames.Name, sName); if (_gLib._Exists(sName, wTP, 3, false)) { _gLib._SetSyncUDWin("Tab", wTP, "Click", 0, false, Config.iClickPos_X, Config.iClickPos_Y); bServiceSelected = true; break; } } if (!bServiceSelected) { _gLib._Report(_PassFailStep.Fail, "Function <" + sFunctionName + "> fail to open service <" + dic["ServiceName"] + ">. Please check input name!"); _gLib._MsgBoxYesNo("Continue Testing?", "Fail: Function <" + sFunctionName + "> fail to open service <" + dic["ServiceName"] + ">. Please check input name!"); return; } if (dic["PopVerify"] == "Verify") { } }
/// <summary> /// RevertReportWizardSettings - Use 'RevertReportWizardSettingsParams' to pass parameters into this method. /// </summary> public void RevertReportWizardSettings() { #region Variable Declarations WinButton uIWizardButton = this.UISmartViewProductionQWindow.UIInspectionSummaryWindow.UIToolBarPreviewWindow.UIWizardButton; WinTabPage uIDataQueryTabPage = this.UIInspectionSummaryWindow.UITabWindow.UIDataQueryTabPage; WinButton uIBtnUndoButton = this.UIInspectionSummaryWindow.UIBtnUndoWindow.UIBtnUndoButton; WinRadioButton uIDataQueryDefectFilteRadioButton = this.UIRevertsettingsWindow.UIDataQueryDefectFilteWindow.UIDataQueryDefectFilteRadioButton; WinButton uIOKButton = this.UIRevertsettingsWindow.UIOKWindow.UIOKButton; WinButton uIFinishButton = this.UIInspectionSummaryWindow.UIFinishWindow.UIFinishButton; WinButton uIOKButton1 = this.UIRichTextParseErrorWindow.UIOKWindow.UIOKButton; WinButton uIOKButton2 = this.UIPagerenderingcrashWindow.UIOKWindow.UIOKButton; #endregion // Click 'Wizard' button Mouse.Click(uIWizardButton, new Point(11, 11)); // Double-Click 'Data Query' tab Mouse.DoubleClick(uIDataQueryTabPage, new Point(49, 11)); // Click 'btnUndo' button Mouse.Click(uIBtnUndoButton, new Point(6, 13)); // Select 'Data Query, Defect Filters, Options, and Formattin...' radio button uIDataQueryDefectFilteRadioButton.Selected = this.RevertReportWizardSettingsParams.UIDataQueryDefectFilteRadioButtonSelected; // Click 'OK' button Mouse.Click(uIOKButton, new Point(33, 14)); // Click 'Finish' button Mouse.Click(uIFinishButton, new Point(33, 17)); // Click 'OK' button //Mouse.Click(uIOKButton1, new Point(60, 13)); // Click 'OK' button //Mouse.Click(uIOKButton2, new Point(31, 11)); }
static void OpenDocument(string filename) { var window = GetWordWindow(); var ribbonWindow = GetWordRibbon(window); var ribbonControl = new WinControl(ribbonWindow); ribbonControl.SearchProperties[UITestControl.PropertyNames.Name] = "Ribbon"; ribbonControl.SearchProperties[UITestControl.PropertyNames.ControlType] = "PropertyPage"; ribbonControl.WindowTitles.Add("Document1 - Word"); var fileButton = new WinButton(ribbonControl); fileButton.SearchProperties[WinButton.PropertyNames.Name] = "File Tab"; fileButton.WindowTitles.Add("Document1 - Word"); Mouse.Click(fileButton); var fileMenu = new WinMenuBar(ribbonWindow); fileMenu.SearchProperties[WinMenu.PropertyNames.Name] = "File"; fileMenu.WindowTitles.Add("Document1 - Word"); var openTab = new WinTabPage(fileMenu); openTab.SearchProperties[WinTabPage.PropertyNames.Name] = "Open"; openTab.WindowTitles.Add("Document1 - Word"); Mouse.Click(openTab); var itemGroup = new WinGroup(window); itemGroup.WindowTitles.Add("Document1 - Word"); var computerTab = new WinTabPage(itemGroup); computerTab.SearchProperties[WinTabPage.PropertyNames.Name] = "Computer"; Mouse.Click(computerTab); var pickaFolderGroup = new WinGroup(window); pickaFolderGroup.SearchProperties[WinControl.PropertyNames.Name] = "Pick a Folder"; var browseButton = new WinButton(pickaFolderGroup); browseButton.SearchProperties[WinButton.PropertyNames.Name] = "Browse"; Mouse.Click(browseButton); var openDlg = new WinWindow(); openDlg.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32770"; openDlg.WindowTitles.Add("Open"); var openDlg1 = new WinWindow(openDlg); openDlg1.SearchProperties[WinWindow.PropertyNames.ControlId] = "1148"; openDlg1.WindowTitles.Add("Open"); var fileNameCombo = new WinComboBox(openDlg1); fileNameCombo.SearchProperties[WinComboBox.PropertyNames.Name] = "File name:"; fileNameCombo.EditableItem = filename; var fileNameEdit = new WinEdit(openDlg1); fileNameEdit.SearchProperties[WinEdit.PropertyNames.Name] = "File name:"; Keyboard.SendKeys(fileNameEdit, "{Enter}", ModifierKeys.None); }
public WinTabPage GetTab(string TabName) { WinWindow TabWin = new WinWindow(GetMainWindow()); TabWin.SearchProperties[WinWindow.PropertyNames.ControlId] = "293"; TabWin.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); WinTabList TabList = new WinTabList(TabWin); TabList.SearchProperties[WinTabList.PropertyNames.Name] = "Tab1"; TabList.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); WinTabPage TabToClick = new WinTabPage(); switch(TabName) { case "AnalysisReport": { WinTabPage AnalysisReport = new WinTabPage(TabList); AnalysisReport.SearchProperties[WinTabPage.PropertyNames.Name] = "Analysis Report"; AnalysisReport.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); TabToClick = AnalysisReport; break; } case "SurfaceParameters": { WinTabPage SurfaceParameters = new WinTabPage(TabList); SurfaceParameters.SearchProperties[WinTabPage.PropertyNames.Name] = "Surface Parameters"; SurfaceParameters.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString())); TabToClick = SurfaceParameters; break; } } return TabToClick; }
/// <summary> /// CheckProfiles - Используйте "CheckProfilesParams" для передачи параметров в этот метод. /// </summary> public void CheckProfiles() { #region Variable Declarations WinTabPage uIConformanceTabPage = this.UIONVIFClientTestToolWindow.UITCMainWindow.UIConformanceTabPage; #endregion if (test.profilesExpectedResult != null) { // Щелкните "Conformance" вкладка uIConformanceTabPage.WaitForControlReady(); Mouse.Click(uIConformanceTabPage); WinCheckBox uIProfileSwitherrataCheckBox = this.UIONVIFClientTestToolWindow.UIProfilesWindow.UIProfileSwitherrataCheckBox; WinCheckBox uIProfileGwitherrataCheckBox = this.UIONVIFClientTestToolWindow.UIProfilesWindow.UIProfileGwitherrataCheckBox; WinCheckBox uIProfileCCheckBox = this.UIONVIFClientTestToolWindow.UIProfilesWindow.UIProfileCCheckBox; WinCheckBox uIProfileQCheckBox = this.UIONVIFClientTestToolWindow.UIProfilesWindow.UIProfileQCheckBox; WinCheckBox uIProfileACheckBox = this.UIONVIFClientTestToolWindow.UIProfilesWindow.UIProfileACheckBox; foreach (var profileExpectedResult in test.profilesExpectedResult) { LogData logDataProfile = new LogData(); logDataProfile.testPath = testPath; logDataProfile.expectedResult = profileExpectedResult.Key + " " + profileExpectedResult.Value; switch (profileExpectedResult.Key) { case "Profile S": { if (uIProfileSwitherrataCheckBox.Enabled) { logDataProfile.currentResult = "Profile S NOT SUPPORTED"; } else { if (uIProfileSwitherrataCheckBox.Checked) { logDataProfile.currentResult = "Profile S SUPPORTED"; } else { logDataProfile.currentResult = "Profile S NOT SUPPORTED"; } } break; } case "Profile G": { if (uIProfileGwitherrataCheckBox.Enabled) { logDataProfile.currentResult = "Profile G NOT SUPPORTED"; } else { if (uIProfileGwitherrataCheckBox.Checked) { logDataProfile.currentResult = "Profile G SUPPORTED"; } else { logDataProfile.currentResult = "Profile G NOT SUPPORTED"; } } break; } case "Profile C": { if (uIProfileCCheckBox.Enabled) { logDataProfile.currentResult = "Profile C NOT SUPPORTED"; } else { if (uIProfileCCheckBox.Checked) { logDataProfile.currentResult = "Profile C SUPPORTED"; } else { logDataProfile.currentResult = "Profile C NOT SUPPORTED"; } } break; } case "Profile Q": { if (uIProfileQCheckBox.Enabled) { logDataProfile.currentResult = "Profile Q NOT SUPPORTED"; } else { if (uIProfileQCheckBox.Checked) { logDataProfile.currentResult = "Profile Q SUPPORTED"; } else { logDataProfile.currentResult = "Profile Q NOT SUPPORTED"; } } break; } case "Profile A": { if (uIProfileACheckBox.Enabled) { logDataProfile.currentResult = "Profile A NOT SUPPORTED"; } else { if (uIProfileACheckBox.Checked) { logDataProfile.currentResult = "Profile A SUPPORTED"; } else { logDataProfile.currentResult = "Profile A NOT SUPPORTED"; } } break; } } if (logDataProfile.currentResult == logDataProfile.expectedResult) { logDataProfile.result = "PASSED"; } else { logDataProfile.result = "FAILED"; } this.logDataProfiles.Add(logDataProfile); } } }
/// <summary> /// SaveCustomizedInspectionSummaryReport - Use 'SaveCustomizedInspectionSummaryReportParams' to pass parameters into this method. /// </summary> public void CreateCustomInspectionSummaryReport(String customeReportName) { #region Variable Declarations WinButton uIWizardButton = this.UISmartViewProductionQWindow.UIInspectionSummaryWindow.UIToolBarPreviewWindow.UIWizardButton; WinTabPage uIReportOptionsTabPage = this.UIInspectionSummaryWindow.UITabWindow.UIReportOptionsTabPage; WinCheckBox uIDisplaynullcountsCheckBox = this.UIInspectionSummaryWindow.UIDisplaynullcountsWindow.UIDisplaynullcountsCheckBox; WinCheckBox uIShowcustomtextCheckBox = this.UIInspectionSummaryWindow.UIShowcustomtextWindow.UIShowcustomtextCheckBox; WinButton uIItemButton = this.UIInspectionSummaryWindow.UIItemWindow1.UIItemButton; WinClient uITestClient = this.UICustomTextWindow.UITextValueWindow.UITestClient; WinButton uIApplyButton = this.UICustomTextWindow.UIApplyWindow.UIApplyButton; WinTabPage uISectionFormattingTabPage = this.UIInspectionSummaryWindow.UITabWindow.UISectionFormattingTabPage; WinComboBox uIComboPageComboBox = this.UIInspectionSummaryWindow.UIComboPageWindow.UIComboPageComboBox; WinRadioButton uILineRadioButton = this.UIInspectionSummaryWindow.UILineWindow.UILineRadioButton; WinCheckBox uILegendCheckBox = this.UIInspectionSummaryWindow.UILegendWindow.UILegendCheckBox; WinCheckBox uILogarithmicscaleCheckBox = this.UIInspectionSummaryWindow.UILogarithmicscaleWindow.UILogarithmicscaleCheckBox; WinButton uISaveButton = this.UIInspectionSummaryWindow.UISaveWindow.UISaveButton; WinEdit uITextNameEdit = this.UISaveCustomReportWindow.UICustomInspectionSummWindow.UITextNameEdit; WinButton uISaveButton1 = this.UISaveCustomReportWindow.UISaveWindow.UISaveButton; #endregion // Click 'Wizard' button Mouse.Click(uIWizardButton, new Point(13, 9)); // Click 'Report Options' tab Mouse.Click(uIReportOptionsTabPage, new Point(36, 11)); // Select 'Display null counts' check box uIDisplaynullcountsCheckBox.Checked = this.SaveCustomizedInspectionSummaryReportParams.UIDisplaynullcountsCheckBoxChecked; // Select 'Show custom text' check box //uIShowcustomtextCheckBox.Checked = this.SaveCustomizedInspectionSummaryReportParams.UIShowcustomtextCheckBoxChecked; // Click '...' button //Mouse.Click(uIItemButton, new Point(8, 13)); // Click 'Test' client //.Click(uITestClient, new Point(157, 19)); //Keyboard.SendKeys(uITestClient, "Test custome text" + customeReportName, ModifierKeys.None); // Type '{Space}at{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}{Back}Test{Space}automation{Space}custom{Space}test{Back}{Back}xt' in 'Test' client //Keyboard.SendKeys(uITestClient, this.SaveCustomizedInspectionSummaryReportParams.UITestClientSendKeys, ModifierKeys.None); // Click 'Apply' button //Mouse.Click(uIApplyButton, new Point(33, 13)); // Click 'Section Formatting' tab Mouse.Click(uISectionFormattingTabPage, new Point(50, 11)); // Select 'Graph' in 'comboPage' combo box uIComboPageComboBox.SelectedItem = this.SaveCustomizedInspectionSummaryReportParams.UIComboPageComboBoxSelectedItem; // Select 'Line' radio button uILineRadioButton.Selected = this.SaveCustomizedInspectionSummaryReportParams.UILineRadioButtonSelected; // Select 'Legend' check box uILegendCheckBox.Checked = this.SaveCustomizedInspectionSummaryReportParams.UILegendCheckBoxChecked; // Select 'Logarithmic scale' check box uILogarithmicscaleCheckBox.Checked = this.SaveCustomizedInspectionSummaryReportParams.UILogarithmicscaleCheckBoxChecked; // Click 'Save' button Mouse.Click(uISaveButton, new Point(39, 11)); // Type 'ATME' in 'textName' text box uITextNameEdit.Text = customeReportName; // Click 'Save' button Mouse.Click(uISaveButton1, new Point(24, 19)); CloseWizardWindow(); }
public void CheckExpectedResult() { this.treeName = "tVTestCases"; #region Variable Declarations WinComboBox uICBConversationsComboBox = this.UIONVIFClientTestToolWindow.UICBConversationsWindow.UICBConversationsComboBox; WinEdit uITBOutputEdit = this.UIONVIFClientTestToolWindow.UITBOutputWindow.UITBOutputEdit; WinTree uITVTestCasesTree = this.UIONVIFClientTestToolWindow.UITVTestCasesWindow.UITVTestCasesTree; WinTabPage uITestDetailsTabPage = this.UIONVIFClientTestToolWindow.UITCLogWindow.UITestDetailsTabPage; WinList uILVStepsList = this.UIONVIFClientTestToolWindow.UILVStepsWindow.UILVStepsList; #endregion if (test.expectedResults != null) { // Щелкните "Test Details" вкладка uITestDetailsTabPage.WaitForControlReady(); Mouse.Click(uITestDetailsTabPage); foreach (DeviceExpectedResult device in test.expectedResults) { this.mac = device.deviceMAC; foreach (ExpectedResult result in device.expectedResults) { foreach (string s in result.expectedResult.Keys) { mTree0 = result.parentNode0; mTree1 = result.parentNode1; mTree2 = s; this.mTreeItem = this.UIONVIFClientTestToolWindow.UITVTestCasesWindow.UIProfileSTestCasesTreeItem.UIMediaProfileConfigurTreeItem.UIMEDIAPROFILECONFIGURTreeItem1; bool currentResultNotStarted = false; // Щелкните по элементу дерева this.mTreeItem.WaitForControlExist(); Mouse.Click(this.mTreeItem); LogData logData = new LogData(); if (uICBConversationsComboBox.Items.Count != 0) { // выбрать элемент в списке устройств uICBConversationsComboBox.SelectedItem = this.macAndDevice["deviceName"] + " - " + this.macAndDevice[this.mac]; foreach (WinListItem item in uILVStepsList.Items) { TestStep testStep = new TestStep(); testStep.results = item.AccessibleDescription; logData.testSteps.Add(testStep); } } else { currentResultNotStarted = true; } if (currentResultNotStarted) { logData.currentResult = s + " NOT STARTED"; } else { if (logData.testSteps.Count == 0) { logData.currentResult = s + " NOT DETECTED"; } else { if (logData.testSteps.FindAll(C => C.results.Contains("NOT DETECTED")).Count != 0) { logData.currentResult = s + " NOT DETECTED"; } else { if (logData.testSteps.FindAll(C => C.results.Contains("FAILED")).Count != 0) { logData.currentResult = s + " FAILED"; } else { logData.currentResult = s + " PASSED"; } } } } logData.expectedResult = s + " " + result.expectedResult[s]; if (logData.currentResult == logData.expectedResult) { logData.result = "PASSED"; } else { logData.result = "FAILED"; } logData.testPath = this.testPath; logData.deviceMAC = this.mac; this.logData.Add(logData); } } } } }
/// <summary> /// RunConformanceTest /// </summary> public void RunConformanceTest() { #region Variable Declarations WinTabPage uIDiagnosticsTabPage = this.UIONVIFClientTestToolWindow.UITCMainWindow.UIDiagnosticsTabPage; //WinButton uIRunConformanceTestButton = this.UIONVIFClientTestToolWindow.UIRunConformanceTestWindow.UIRunConformanceTestButton; WinButton uIRunConformanceTestButton = this.UIONVIFClientTestToolWindow.UIM_ToolStripToolBar.UIRunConformanceTestButton; WinWindow uIОКWindow = this.UIWarningWindow.UIОКWindow; WinList uILVUnitsList = this.UIONVIFClientTestToolWindow.UILVUnitsWindow.UILVUnitsList; #endregion string stepName = ""; try { stepName = "GetFeaturesList"; foreach (DeviceExpectedResult device in this.test.expectedResults) { this.mac = device.deviceMAC; foreach (WinCheckBox listItem in uILVUnitsList.Items) { if (listItem.AccessibleDescription.Contains(device.deviceMAC)) { string name = listItem.AccessibleDescription.Substring(listItem.AccessibleDescription.IndexOf("Name: ") + 6, listItem.AccessibleDescription.IndexOf("; MAC", 11) - 12); this.macAndDevice.Add(this.mac, name); break; } } } WinTabPage uIConformanceTabPage = this.UIONVIFClientTestToolWindow.UITCMainWindow.UIConformanceTabPage; WinEdit uITBProductNameEdit = this.UIONVIFClientTestToolWindow.UITBProductNameWindow.UITBProductNameEdit; stepName = "OpenConformanceTab"; uIConformanceTabPage.WaitForControlReady(); Mouse.Click(uIConformanceTabPage); stepName = "GetClientName"; uITBProductNameEdit.WaitForControlReady(); this.macAndDevice.Add("deviceName", uITBProductNameEdit.Text); // Щелкните "Diagnostics" вкладка stepName = "OpenDiagnosticsTab"; uIDiagnosticsTabPage.WaitForControlReady(10000); Mouse.Click(uIDiagnosticsTabPage); // Щелкните "Run Conformance Test" кнопка stepName = "RunConformance"; uIRunConformanceTestButton.WaitForControlReady(10000); Mouse.Click(uIRunConformanceTestButton); stepName = "CheckFeaturesWarningWindow"; if (uIОКWindow.Exists) { WinButton uIОКButton = this.UIWarningWindow.UIОКWindow.UIОКButton; // Щелкните "ОК" кнопка uIОКButton.WaitForControlReady(); Mouse.Click(uIОКButton); } stepName = "WaitingDone"; WinText text = this.UIONVIFClientTestToolWindow.UISSMainStatusBar.UIItemText; System.Threading.Thread.Sleep(1000); stepName = "WaitingDone2"; text.WaitForControlExist(5000); stepName = "WaitingDone3"; System.Threading.Thread.Sleep(1000); text.WaitForControlCondition(IsStatusDone, 2700000); stepName = "WaitingDone4"; } catch (Exception e) { throw new Exception(String.Format("Substep Name {0}. /n Message: {1}", stepName, e.Message), e); } }
private void FindTab(string tabName) { FindTabManager(); _tab = new WinTabPage(_tabManager); _tab.SearchProperties[UITestControl.PropertyNames.Name] = tabName; }
/// <summary> /// Click the specific tab control /// </summary> /// <param name="name">The tabPage's name</param> /// <exception cref="Exception">If the control is not found</exception> public static void ClickTabPage(string name) { WinTabPage tabPage = (WinTabPage)Robot.FindWinControl(typeof(WinTabPage), name, _root); Mouse.Click(tabPage); }
public WinTabPage GetCUITTabpage(WinWindow w, string searchBy, string searchValue, int index) { Console.WriteLine("Inside function GetCUITTabpage"); WinTabPage GetCUITTabpage = new WinTabPage(w); try { Playback.Initialize(); switch (searchBy.Trim().ToLower()) { case "text": { if (index == -1) { GetCUITTabpage.SearchProperties[WinTabPage.PropertyNames.Name] = searchValue; } else { GetCUITTabpage.SearchProperties.Add(WinTabPage.PropertyNames.Name, searchValue); UITestControlCollection tabPageCollection = GetCUITTabpage.FindMatchingControls(); GetCUITTabpage = (WinTabPage)tabPageCollection[index]; } break; } case "automationid": { if (index == -1) { GetCUITTabpage.SearchProperties.Add(WinTabPage.PropertyNames.ControlName, searchValue); UITestControlCollection tabPageCollection = GetCUITTabpage.FindMatchingControls(); GetCUITTabpage = (WinTabPage)tabPageCollection[0]; } else { GetCUITTabpage.SearchProperties.Add(WinTabPage.PropertyNames.ControlName, searchValue); UITestControlCollection tabPageCollection = GetCUITTabpage.FindMatchingControls(); GetCUITTabpage = (WinTabPage)tabPageCollection[index]; } break; } default: throw new Exception(_error); } Playback.Cleanup(); Console.WriteLine("Found Tab and exiting function GetCUITTabpage"); return GetCUITTabpage; } catch (Exception e) { var st = new StackTrace(e, true); var testFrame = st.GetFrame(0); for (int i = 0; i < st.FrameCount; i++) { testFrame = st.GetFrame(i); if (testFrame.GetFileName() != null) { if (testFrame.GetFileName().ToString().Contains("CUITFramework.cs") == true) { break; } } } // Get the top stack frame var frame = testFrame; // Get the line number from the stack frame var line = frame.GetFileLineNumber(); logTofile(_eLogPtah, "Error in GetCUITTabpage and in line: " + line); throw new Exception(_error + "CUITRButton:" + System.Environment.NewLine + e.Message); } }