/// <summary> /// 2015-June-26 /// [email protected] /// /// sample: /// pTrancheDefinition._DefinitionFPGrid_RightSelect("Active", 1, "Pre1997", "Edit Tranche"); /// pTrancheDefinition._DefinitionFPGrid_RightSelect("Deferred", 1, "Pre1997", "Edit Tranche"); /// pTrancheDefinition._DefinitionFPGrid_RightSelect("Pensioner", 1, "Pre1997", "Edit Tranche"); /// pTrancheDefinition._DefinitionFPGrid_RightSelect("Pensioner", 3, "Pst2005", "Edit Tranche"); /// </summary> /// <param name="sType"></param> /// <param name="sMenuItem"></param> public void _DefinitionFPGrid_RightSelect(string sType, int iRow, string sLabel, string sMenuItem) { string sFunctionName = "_DefinitionFPGrid_RightSelect"; _gLib._Report(_PassFailStep.Step, "Function <" + sFunctionName + "> Starts:"); string sActLabel = ""; string sDownKeys = "{PageUp}"; for (int i = 1; i < iRow; i++) { sDownKeys = sDownKeys + "{Down}"; } WinClient grid = new WinClient(); switch (sType) { case "Active": grid = this.wRetirementStudio.wActive_Definitions_FPGrid.grid; break; case "Deferred": grid = this.wRetirementStudio.wDeferred_Definitions_FPGrid.grid; break; case "Pensioner": grid = this.wRetirementStudio.wPensioner_Definitions_FPGrid.grid; break; default: _gLib._MsgBoxYesNo("Continue Testing?", "Fail: Function <" + sFunctionName + "> failed because input Type does NOT exists."); break; } _gLib._SetSyncUDWin(sType, grid, "Click", 0, false, 30, 40); _gLib._SendKeysUDWin(sType, grid, sDownKeys); sActLabel = _fp._ReturnSelectRowContentByClipboard(grid); if (!sActLabel.ToUpper().Contains(sLabel.ToUpper())) { _gLib._Report(_PassFailStep.Fail, "Function <" + sFunctionName + "> fail to find label <" + sLabel + "> at row <" + iRow + "> on grid <" + sType + ">"); _gLib._MsgBoxYesNo("Continue Testing?", "Fail: Function <" + sFunctionName + "> fail to find label <" + sLabel + "> at row <" + iRow + "> on grid <" + sType + ">"); } else { try { Mouse.Click(grid, MouseButtons.Right, ModifierKeys.None, new Point(30, 40 + (iRow - 1) * 20)); } catch (Exception ex) { _gLib._Report(_PassFailStep.Fail, "Function <" + sFunctionName + "> fail to Right click ongrid <" + sType + ">. Because of Exception thrown: " + Environment.NewLine + ex.Message); _gLib._MsgBoxYesNo("Continue Testing?", "Fail: Function <" + sFunctionName + "> fail to Right click on TreeView item <" + sType + ">. Because of Exception thrown: " + Environment.NewLine + ex.Message); } WinWindow wWin = new WinWindow(); wWin.SearchProperties.Add(WinWindow.PropertyNames.AccessibleName, "DropDown"); wWin.SearchProperties.Add(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains); wWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); wWin.SearchConfigurations.Add(SearchConfiguration.VisibleOnly); if (_gLib._Exists("DropDown Menu Parent Win", wWin, 0)) { MyDictionary dicTmp = new MyDictionary(); dicTmp.Clear(); dicTmp.Add("Level_1", sMenuItem); _gLib._MenuSelectWin(0, wWin, dicTmp); } } _gLib._Report(_PassFailStep.Step, "Function <" + sFunctionName + "> Ends:"); }
/// <summary> /// 2015-Apr-12 /// [email protected] /// /// sample: /// dic.Clear(); /// dic.Add("PopVerify", "Pop"); /// dic.Add("iRow", "1"); /// dic.Add("JubileeBenefit", "JubileeBenefit1"); /// dic.Add("Eligibility", ""); /// dic.Add("Factor", ""); /// dic.Add("Jubilee", "True"); /// dic.Add("Retirement", ""); /// dic.Add("Disability", ""); /// dic.Add("Death", ""); /// dic.Add("GraceYears", ""); /// dic.Add("GraceFactor", "1,00000"); /// pPlanDefinition_DE._Table(dic); /// </summary> /// <param name="dic"></param> public void _Table(MyDictionary dic) { string sFunctionName = "_Table"; _gLib._Report(_PassFailStep.Step, "Function <" + sFunctionName + "> Starts:"); int iRow = Convert.ToInt32(dic["iRow"]); int iPosX = 40; int iPosY = 20 * iRow + 10; _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); //if (iRow >= 6) //{ // _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 3, false, 670, 50); // _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{PageUp}{PageUp}{PageUp}{PageUp}{PageUp}{PageUp}", 0); //} ////////_gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); if (dic["JubileeBenefit"] != "") { _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Tab}"); _gLib._SendKeysUDWin("sData", this.wRetirementStudio.wFPGrid.grid, "{Tab}", 0, ModifierKeys.Shift, false); _gLib._SetSyncUDWin("JubileeBenefit", this.wRetirementStudio.wCommon_cbo.cbo, dic["JubileeBenefit"], 0); } if (dic["Eligibility"] != "") { _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Tab}"); _gLib._SetSyncUDWin("Eligibility", this.wRetirementStudio.wCommon_cbo.cbo, dic["Eligibility"], 0); } if (dic["Factor"] != "") { _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Tab}{Tab}"); _gLib._SetSyncUDWin_ByClipboard("Factor", this.wRetirementStudio.wCommon_txt.txt, dic["Factor"], 0); } if (dic["Jubilee"] != "") { Clipboard.Clear(); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Tab}{Tab}{Tab}"); _gLib._SendKeysUDWin("Jubilee", this.wRetirementStudio.wFPGrid.grid, "{Space}{Space}{Space}"); string sAct = ""; sAct = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sAct.ToUpper().Contains(dic["Jubilee"].ToUpper())) { _gLib._SendKeysUDWin("Jubilee", this.wRetirementStudio.wFPGrid.grid, "{Space}{Space}"); } sAct = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sAct.ToUpper().Contains(dic["Jubilee"].ToUpper())) { _gLib._SendKeysUDWin("Jubilee", this.wRetirementStudio.wFPGrid.grid, "{Space}"); } sAct = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sAct.ToUpper().Contains(dic["Jubilee"].ToUpper())) { _gLib._MsgBoxYesNo("Continue Testing?", "Fail: Function <" + sFunctionName + "> failed to set data <" + dic["Jubilee"] + "> at Row <" + iRow + ">"); } } if (dic["Retirement"] != "") { _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); Clipboard.Clear(); _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Tab}{Tab}{Tab}{Tab}"); _gLib._SendKeysUDWin("Jubilee", this.wRetirementStudio.wFPGrid.grid, "{Space}{Space}{Space}"); string sData = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sData.ToUpper().Contains(dic["Retirement"].ToUpper())) { _gLib._SendKeysUDWin("Jubilee", this.wRetirementStudio.wFPGrid.grid, "{Space}{Space}"); } sData = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sData.ToUpper().Contains(dic["Retirement"].ToUpper())) { _gLib._SendKeysUDWin("Jubilee", this.wRetirementStudio.wFPGrid.grid, "{Space}"); } sData = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sData.ToUpper().Contains(dic["Retirement"].ToUpper())) { _gLib._MsgBoxYesNo("Continue Testing?", "Fail: Function <" + sFunctionName + "> failed to set data <" + dic["Retirement"] + "> at Row <" + iRow + ">"); } } if (dic["Disability"] != "") { _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Tab}{Tab}{Tab}{Tab}{Tab}"); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Space}{Space}"); string sData = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sData.ToUpper().Contains(dic["Disability"].ToUpper())) { _gLib._SendKeysUDWin("Disability", this.wRetirementStudio.wFPGrid.grid, "{Space}"); } sData = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sData.ToUpper().Contains(dic["Disability"].ToUpper())) { _gLib._SendKeysUDWin("Disability", this.wRetirementStudio.wFPGrid.grid, "{Space}"); } sData = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sData.ToUpper().Contains(dic["Disability"].ToUpper())) { _gLib._MsgBoxYesNo("Continue Testing?", "Fail: Function <" + sFunctionName + "> failed to set data <" + dic["Disability"] + "> at Row <" + iRow + ">"); } } if (dic["Death"] != "") { _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); Clipboard.Clear(); _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}"); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Space}{Space}"); string sData = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sData.ToUpper().Contains(dic["Death"].ToUpper())) { _gLib._SendKeysUDWin("Jubilee", this.wRetirementStudio.wFPGrid.grid, "{Space}"); } sData = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sData.ToUpper().Contains(dic["Death"].ToUpper())) { _gLib._SendKeysUDWin("Jubilee", this.wRetirementStudio.wFPGrid.grid, "{Space}"); } sData = _fp._ReturnSelectRowContentByClipboard(this.wRetirementStudio.wFPGrid.grid); if (!sData.ToUpper().Contains(dic["Death"].ToUpper())) { _gLib._MsgBoxYesNo("Continue Testing?", "Fail: Function <" + sFunctionName + "> failed to set data <" + dic["Death"] + "> at Row <" + iRow + ">"); } } if (dic["GraceYears"] != "") { _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}"); _gLib._SetSyncUDWin_ByClipboard("GraceYears", this.wRetirementStudio.wCommon_txt.txt, dic["GraceYears"], 0); } if (dic["GraceFactor"] != "") { _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Home}", 0, ModifierKeys.Control, false); _gLib._SetSyncUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "Click", 1, false, iPosX, iPosY); _gLib._SendKeysUDWin("Table", this.wRetirementStudio.wFPGrid.grid, "{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}"); _gLib._SetSyncUDWin_ByClipboard("GraceFactor", this.wRetirementStudio.wCommon_txt.txt, dic["GraceFactor"], 0); } _gLib._Report(_PassFailStep.Step, "Function <" + sFunctionName + "> Ends:"); }