/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; TCOS_POC_DEMOAPPRepository repo = TCOS_POC_DEMOAPPRepository.Instance; Ranorex.List HDComboBox = repo.RxMainFrame.RxTabUIElements.LstTestBox; HDComboBox.Click(Location.Center); IList <Ranorex.ListItem> MyListItems = HDComboBox.FindDescendants <Ranorex.ListItem>(); string[] actualStrArrItems; actualStrArrItems = new string[MyListItems.Count]; foreach (Ranorex.ListItem ThisListItem in MyListItems) { actualStrArrItems[ThisListItem.Index] = ThisListItem.Text.ToString(); } Validate.AreEqual(string.Join(",", actualStrArrItems), expectedListItems); }
public void Get_value_LstTestBox(RepoItemInfo listInfo, string listItems) { TCOS_POC_DEMOAPPRepository repo = TCOS_POC_DEMOAPPRepository.Instance; Ranorex.List HDComboBox = listInfo.FindAdapter <List>(); HDComboBox.Click(Location.Center); IList <Ranorex.ListItem> MyListItems = HDComboBox.FindDescendants <Ranorex.ListItem>(); string[] actualStrArrItems; actualStrArrItems = new string[MyListItems.Count]; foreach (Ranorex.ListItem ThisListItem in MyListItems) { actualStrArrItems[ThisListItem.Index] = ThisListItem.Text.ToString(); } // Report.Log(ReportLevel.Info,"**"+string.Join(",", actualStrArrItems)+"**"); // Report.Log(ReportLevel.Info,"**"+listItems+"**"); Validate.AreEqual(string.Join(",", actualStrArrItems), listItems); }
public static void SelectServers() { try { Ranorex.List serversLists = null; if (repo.AddPermissionWizard.AvailableServersInfo.Exists()) { serversLists = repo.AddPermissionWizard.AvailableServers; if (serversLists.Children.Count >= 1) { //Report.Info("serversLists.Items[0]: " + serversLists.Items[0]); //serversLists.Children[0].Click(); serversLists.Items[0].Click(); Reports.ReportLog("Selected Server", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } else { Reports.ReportLog("No Servers Available in Server List : ", Reports.SQLdmReportLevel.Info, null, Configuration.Config.TestCaseName); } } else { Reports.ReportLog("Available Server Dialog not exists : ", Reports.SQLdmReportLevel.Info, null, Configuration.Config.TestCaseName); } } catch (Exception ex) { throw new Exception("Failed : ClickOptionBtn_ViewDataAcknowledgwAlarm : " + ex.Message); } }
public static void GetItem(this Ranorex.List list, int index) { try { list.Items[index].Select(); } catch (Exception ex) { throw new Exception("List Get Item Failed : " + ex.Message); } }
public static void SelectListItem(this Ranorex.List aList, string item) { int idx = 0; foreach (ListItem currentItem in aList.Items) { if (currentItem.Text == item) { break; } idx++; } aList.Items[idx].Select(); }
public static void SelectServers() { try { Ranorex.List serversLists = null; if (repo.AddPermissionWizard.AvailableServersInfo.Exists()) { serversLists = repo.AddPermissionWizard.AvailableServers; int itemCount = serversLists.Children.Count; Report.Info("Servers Count =" + itemCount.ToString()); if (itemCount >= 2) { //Report.Info("serversLists.Items[0]: " + serversLists.Items[0]); //serversLists.Children[0].Click(); serversLists.Items[0].Click(); Thread.Sleep(2000); // serversLists.Items[0].PressKeys("{LControlKey down}{LShiftKey down}"); // Thread.Sleep(2000); // // //serversLists.Items[itemCount/2+1].EnsureVisible(); // serversLists.Items[itemCount/2+1].Click(); // serversLists.Items[itemCount/2+1].PressKeys("{LControlKey up}{LShiftKey up}"); Reports.ReportLog("Selected Server", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } else if (itemCount == 1) { serversLists.Items[0].Click(); Reports.ReportLog("Selected Server", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } else { //Reports.ReportLog("No Servers Available in Server List", Reports.SQLdmReportLevel.Info, null, Configuration.Config.TestCaseName); Validate.Fail("No Servers Available in Server List"); } } else { //Reports.ReportLog("Available Server Dialog not exists : ", Reports.SQLdmReportLevel.Info, null, Configuration.Config.TestCaseName); Validate.Fail("Available Server Dialog not exists"); } } catch (Exception ex) { throw new Exception("Failed : SelectServers : " + ex.Message); } }