// 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 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 VerifySqlUserAdded() { try { repo.Application.TableSystemLoginsWhichBelongInfo.WaitForItemExists(200000); Ranorex.Cell cellUser = null; cellUser = repo.Application.TableSystemLoginsWhichBelong.FindSingle("//cell[@accessiblevalue='" + Config.NewSqlUser + "']"); //Report.Info(cellUser.Visible.ToString() + cellUser.Enabled.ToString()+ cellUser.Text.ToString()); //if(repo.Application.NewSqlUserAddedInfo.Exists()) if (cellUser.GetAttributeValue <string>("accessiblevalue").ToLower().Equals(Config.NewSqlUser.ToLower())) { Reports.ReportLog("New Sql User Added Successfully ! ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } else { Reports.ReportLog("New Sql User not Added : ", Reports.SQLdmReportLevel.Info, null, Configuration.Config.TestCaseName); Validate.Fail("New Sql User not Added Successfully"); } } catch (Exception ex) { throw new Exception("Failed : VerifySqlUserAdded : " + ex.Message); } }
public static void VerifyUserAdded(string userType) { try { string user = null; if (userType.ToLower().Equals(Config.NewSqlUser.ToLower())) { user = Config.NewSqlUser; } else { user = Config.NewWindowsUser; } repo.Application.TableSystemLoginsWhichBelongInfo.WaitForItemExists(200000); //Ranorex.Cell cellUser = repo.Application.TableSystemLoginsWhichBelong.FindSingle("/row[1]/cell[@accessiblevalue='"+ user +"']"); Ranorex.Cell cellUser = Host.Local.FindSingle <Ranorex.Cell>(@"/form[@title~'^Idera\ SQL\ diagnostic\ mana']/statusbar[@automationid='statusBar']//container[@automationid='viewContainer']/container[@automationid='windowsFormsHostControl']//container[@controlname='_child']//container[@controlname='ApplicationSecurityView_Fill_Panel']//table[@accessiblename~'^\ \ \ \ \ \ \ System\ logins,\ whi']/row[1]/cell[@accessiblevalue='" + user + "']"); if (cellUser.Text.ToLower().Equals(user.ToLower())) { cellUser.Click(); Reports.ReportLog("New User " + user + " Added Successfully ! ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } else { Reports.ReportLog("New User " + user + " not Added : ", Reports.SQLdmReportLevel.Info, null, Configuration.Config.TestCaseName); Validate.Fail("New User not " + user + " Added Successfully"); } } catch (Exception ex) { throw new Exception("Failed : VerifyUserAdded : " + ex.Message); } }
private void CreateApptDrgNDropWithinSameDay() { //calendar.MainForm.Self.Activate(); calendar.MainForm.btnCalendar.Click(); calendar.MainForm.btnNewAppointment.Click(); Delay.Seconds(1); calendar.EventDetailForm.PnlBase.txtAppointmentTitle.PressKeys(data); calendar.EventDetailForm.PnlBase.txtStartTime.PressKeys(System.DateTime.Now.ToShortTimeString()); calendar.EventDetailForm.PnlBase.txtEndTime.PressKeys(System.DateTime.Now.AddHours(1).ToShortTimeString()); calendar.EventDetailForm.btnOK.Click(); Delay.Seconds(3); AppointmentOverlapPrompt(); ValidateEventRemainderPopup(); calendar.MainForm.btnCalendar.Click(); calendar.MainForm.btnViewMenu.Click(); calendar.MainForm.menuListView.Click(); Delay.Seconds(3); cmn.VerifyDataExistsInTable(calendar.MainForm.tblCalendar, data, "Calendar List"); calendar.MainForm.Toolbar.btnToday.Click(); calendar.MainForm.PnlViews.tbCurrentDay.Click(); //calendar.EventDetailForm.btnCancel.Click(); calendar.MainForm.Self.Activate(); string currentDayData = String.Format("Appointment '{0}'", data); calendar.curdayapptselection = currentDayData; Ranorex.Cell curdaysource = calendar.MainForm.PnlViews.txtCurrentDayAppt; string destTime = RoundUpTimeFormat(System.DateTime.Now); calendar.curdayapptselection = destTime; DragNDropLibrary.DragAndDrop(curdaysource, calendar.MainForm.PnlViews.txtCurrentDayAppt); }
public static string GetCell(this Ranorex.Table grid, string cellName, int rowNumber) { rowNumber--; Ranorex.Cell myCel = grid.FindSingle(String.Format("?/?/cell[@accessiblename='{0} Row {1}']", cellName, rowNumber.ToString())); return(myCel.Text); }
//********************************************************************** /// <summary> /// Click to given items in the comoponet like List, Table and Tree. /// </summary> public static void Select_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.Click(); } 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.Click(); } if (objType.Name.ToString() == "Tree") { int treeLevel = Convert.ToInt32(item.getArgText()); string strTreelevel = ""; string strTreelevelCkb = ""; for (int i = 1; i <= treeLevel; i++) { strTreelevel += "/treeitem"; strTreelevelCkb += "/checkbox"; } RepoItemInfo targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem", objComponetInfo.Path + strTreelevel + "[@accessiblename='" + item.getArg2Text() + "']", 10000, null, System.Guid.NewGuid().ToString()); if (targetTreeItemInfo.Exists()) { Ranorex.TreeItem targetTreeItem = targetTreeItemInfo.CreateAdapter <Ranorex.TreeItem>(true); targetTreeItem.Click(); } else { targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem1", objComponetInfo.Path + strTreelevelCkb + "[@accessiblename='" + item.getArg2Text() + "']", 10000, null, System.Guid.NewGuid().ToString()); Ranorex.CheckBox targetTreeItemCkb = targetTreeItemInfo.CreateAdapter <Ranorex.CheckBox>(true); targetTreeItemCkb.Click(); } } }
public static void RightClick(this Ranorex.Cell item) { try { Mouse.Click(item, System.Windows.Forms.MouseButtons.Right, new Point(30, 10)); } catch (Exception ex) { throw new Exception("Cell Right Click Failed : " + 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(); */ } }
public static void SelectCell(this Ranorex.Table grid, string cellName, int rowNumber, string text) { rowNumber--; Ranorex.Cell myCel = grid.FindSingle(String.Format("?/?/cell[@accessiblename='{0} Row {1}']", cellName, rowNumber.ToString())); // myCel.Click(); // myCel.ClickWithoutBoundsCheck(Location.Center); myCel.ClickWithoutBoundsCheck(Location.CenterLeft); if (text != "") { myCel.PressKeys(text); } }