public static void EditUserInUserTable(string userType) { try { Ranorex.Cell cellUser = null; if (userType.ToLower() == "sqluser") { cellUser = repo.Application.TableSystemLoginsWhichBelong.FindSingle("//cell[@accessiblevalue='" + Constants.NewSqlUser + "']"); } else { cellUser = repo.Application.TableSystemLoginsWhichBelong.FindSingle("//cell[@accessiblevalue='" + Constants.NewWindowsUser + "']"); } cellUser.MoveTo(); //Thread.Sleep(2000); cellUser.Click(); //Thread.Sleep(2000); cellUser.DoubleClick(); Reports.ReportLog("Opened User in Edit mode Successfully ! ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } catch (Exception ex) { throw new Exception("Failed : EditUserInUserTable : " + ex.Message); } }
// public static void VerifyPermissionChanged() // { // try // { // // repo.PermissionPropertiesSIMPSONSAdminis.AdministratorPowersInSQLDiagnosticM.Click(); // repo.PermissionPropertiesSIMPSONSAdminis.ButtonOK.ClickThis(); // Reports.ReportLog("Permission Changed to 'Administrator Powers in Sql DM' " , Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); // } // catch(Exception ex) // { // throw new Exception("Failed : ChangePermission : " + ex.Message); // } // } public static void VerifyViewDataAcknowledgwAlarmIsSelected(string userType) { try { string user = null; if (userType.ToLower().Equals(Constants.WindowsUser.ToLower())) { user = Config.NewWindowsUser; } else { user = Config.NewSqlUser; } repo.Application.TableSystemLoginsWhichBelongInfo.WaitForItemExists(200000); Ranorex.Cell cellUser = Host.Local.FindSingle <Ranorex.Cell>(UserTableRow1 + "/cell[@accessiblevalue='" + user + "']"); cellUser.DoubleClick(); if (repo.PermissionPropertyDialog.ViewDataAcknowledgwAlarm.Checked) { Reports.ReportLog("ViewDataAcknowledgwAlarm Option is Selected ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } else { Reports.ReportLog("ViewDataAcknowledgwAlarm Option Not Selected : ", Reports.SQLdmReportLevel.Info, null, Configuration.Config.TestCaseName); Validate.Fail("ViewDataAcknowledgwAlarm Option Not Selected"); } } catch (Exception ex) { throw new Exception("Failed : VerifyViewDataAcknowledgwAlarmIsSelected : " + ex.Message); } }
public static void DoubleClickThis(this Ranorex.Cell item) { try { item.DoubleClick(); Sleep(); } catch (Exception ex) { throw new Exception("Button Click Failed : " + ex.Message); } }
//********************************************************************** /// <summary> /// DoubleClick to given items in the comoponet like List, Table and Tree. /// </summary> public static void DoubleClick_Item(LxScriptItem item) { object objComponet = item.getComponent(); RepoItemInfo objComponetInfo = item.getComponentInfo(); Type objType = objComponet.GetType(); //MessageBox.Show(objType.Name.ToString()); if (objType.Name.ToString() == "List") { RepoItemInfo targetListItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableListItem", objComponetInfo.Path + "/listitem[@accessiblename='" + item.getArgText() + "']", 10000, null, System.Guid.NewGuid().ToString()); Ranorex.ListItem targetListItem = targetListItemInfo.CreateAdapter <Ranorex.ListItem>(true); targetListItem.DoubleClick(); } if (objType.Name.ToString() == "Table") { RepoItemInfo targetCellInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableCell", objComponetInfo.Path + "/row/cell[@text='" + item.getArgText() + "']", 10000, null, System.Guid.NewGuid().ToString()); Ranorex.Cell targetCell = targetCellInfo.CreateAdapter <Ranorex.Cell>(true); targetCell.DoubleClick(); } if (objType.Name.ToString() == "Tree") { int treeLevel = Convert.ToInt32(item.getArgText()); string strTreelevel = ""; for (int i = 1; i <= treeLevel; i++) { strTreelevel += "/treeitem"; } RepoItemInfo targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem", objComponetInfo.Path + strTreelevel + "[@accessiblename='" + item.getArg2Text() + "']", 10000, null, System.Guid.NewGuid().ToString()); Ranorex.TreeItem targetTreeItem = targetTreeItemInfo.CreateAdapter <Ranorex.TreeItem>(true); targetTreeItem.DoubleClick(); /* * Ranorex.Control treeViewControl = targetTreeItem.Element.As<Ranorex.Control>(); * System.Windows.Forms.TreeNode node = treeViewControl.InvokeMethod( * "GetNodeAt", * new object[] { targetTreeItem.Element.ClientRectangle.Location + new Size(1, 1) }) * as System.Windows.Forms.TreeNode; * object mynode = node.GetLifetimeService(); * Ranorex.CheckBox mycheckbox = (Ranorex.CheckBox)mynode; * mycheckbox.Check(); */ } }
//********************************************************************** /// <summary> /// DoubleClick to given items in the comoponet like List, Table and Tree. /// </summary> public static void DoubleClick_Item(LxScriptItem item) { object objComponet = item.getComponent(); RepoItemInfo objComponetInfo = item.getComponentInfo(); Type objType = objComponet.GetType(); //MessageBox.Show(objType.Name.ToString()); if (objType.Name.ToString() == "List") { RepoItemInfo targetListItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableListItem", objComponetInfo.Path + "/listitem[@accessiblename='" + item.getArgText() + "']", 10000, null, System.Guid.NewGuid().ToString()); Ranorex.ListItem targetListItem = targetListItemInfo.CreateAdapter <Ranorex.ListItem>(true); targetListItem.DoubleClick(); } if (objType.Name.ToString() == "Table") { RepoItemInfo targetCellInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableCell", objComponetInfo.Path + "/row/cell[@text='" + item.getArgText() + "']", 10000, null, System.Guid.NewGuid().ToString()); Ranorex.Cell targetCell = targetCellInfo.CreateAdapter <Ranorex.Cell>(true); targetCell.DoubleClick(); } if (objType.Name.ToString() == "Tree") { int treeLevel = Convert.ToInt32(item.getArgText()); string strTreelevel = ""; for (int i = 1; i <= treeLevel; i++) { strTreelevel += "/treeitem"; } RepoItemInfo targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem", objComponetInfo.Path + strTreelevel + "[@accessiblename='" + item.getArg2Text() + "']", 10000, null, System.Guid.NewGuid().ToString()); Ranorex.TreeItem targetTreeItem = targetTreeItemInfo.CreateAdapter <Ranorex.TreeItem>(true); targetTreeItem.DoubleClick(); } }