public static IControl GetPermissionStatus(String category, String permissionName, String permissionType, out PermissionStatus permissionStatus) { permissionStatus = PermissionStatus.None; IControl c = null; if (!String.IsNullOrEmpty(category) && !String.IsNullOrEmpty(permissionName) && !String.IsNullOrEmpty(permissionType)) { category = category.Replace(" ", String.Empty); String id = "Permissions_" + category; permissionName = permissionName.Replace(" ", String.Empty); permissionName = permissionName.Replace("/", String.Empty); permissionType = permissionType.Replace(" ", String.Empty); ReadOnlyCollection <IControl> rows = SyncUtilities.FindElements(By.Id(id)); foreach (IControl row in rows) { IControl cell = SyncUtilities.FindElement_Parent(row.WebElement, By.Id(permissionName)); if (cell.WebElement != null) { return(GetCellStatus(row, permissionType, out permissionStatus)); } } } return(c); }
public static List <IControl> ExpandCollapseButtonForAllSections() { List <IControl> expandSection = new List <IControl> { }; expandSection.AddRange(SyncUtilities.FindElements(By.Id("collapseExpand"))); return(expandSection); }
public static IControl GetHistoryRow(int rowIndex) { ReadOnlyCollection <IControl> rows = SyncUtilities.FindElements(By.ClassName("history-row")); if (rowIndex < rows.Count) { return(rows[rowIndex]); } return(null); }
public static ReadOnlyCollection <IControl> GetCodelistBackGroundColor() { List <IControl> cList = new List <IControl>(); ReadOnlyCollection <IControl> dropdownItemsList = SyncUtilities.FindElements(By.XPath("//*[contains(@id, 'txtDetailTargetName')]")); foreach (IControl c in dropdownItemsList) { cList.Add(c); } return(new ReadOnlyCollection <IControl>(cList)); }
public static ReadOnlyCollection <IControl> GetDomainIncudeCheckboxes() { List <IControl> cList = new List <IControl>(); ReadOnlyCollection <IControl> dropdownItemsList = SyncUtilities.FindElements(By.XPath("//*[contains(@id, 'chkIncludeTargetName')]")); foreach (IControl c in dropdownItemsList) { cList.Add(c); } return(new ReadOnlyCollection <IControl>(cList)); }
static IControl GetActiveFilters() { ReadOnlyCollection <IControl> list = SyncUtilities.FindElements(By.CssSelector("div[class='k-animation-container']")); foreach (IControl c in list) { if (c.WebElement.GetCssValue("display").Equals("block", StringComparison.InvariantCultureIgnoreCase)) { return(c); } } return(null); }
static List <String> GetSelectFormatRadioTexts() { List <String> allTexts = new List <String>(); ReadOnlyCollection <IControl> actualText = SyncUtilities.FindElements(By.XPath("//input[@name='outputFmt']")); if (actualText != null) { foreach (IControl item in actualText) { allTexts.Add(BP_wf_ActionUtil.GetPropertyOfAnObject(item, "displaytext")); } } return(allTexts); }
public static bool ExpandAllchevrons() { try { ReadOnlyCollection <IControl> ChevronList = SyncUtilities.FindElements(By.XPath("//*[contains(@src,'expand')]")); foreach (IControl c in ChevronList) { c.WebElement.Click(); } return(true); } catch (Exception e) { return(false); } }
public static List <string> GetColumnHeaderTextFromResultTable(By control) { List <String> allTexts = new List <String>(); ReadOnlyCollection <IControl> tableRw = SyncUtilities.FindElements(control); int iCount = tableRw.Count; if (iCount != 0) { foreach (IControl item in tableRw) { allTexts.Add(BP_wf_ActionUtil.GetPropertyOfAnObject(item, "title")); } } return(allTexts); }
public static IControl GetSectionHeaderByText(String SectionText) { IControl ctrl = null; BrowserUtilities.SwitchToWebFocusFrame(); ReadOnlyCollection <IControl> section = SyncUtilities.FindElements(By.ClassName("sectionHeader")); foreach (IControl c in section) { if (c.WebElement.Text.ToUpper().Contains(SectionText.ToUpper())) { ctrl = c; return(ctrl); } } return(ctrl); }
private static IControl GetTableHeaderByText(string headerText) { IControl ctrl = null; //BrowserUtilities.SwitchToWebFocusFrame(); BP_wf_VerificationHelpers.WaitAndFindVisibleElement(By.XPath("//table['id=headerTbl']/td[class='launchPageTitleClass']")); ReadOnlyCollection <IControl> section = SyncUtilities.FindElements(By.XPath("//table['id=headerTbl']/td[class='launchPageTitleClass']")); foreach (IControl c in section) { if (c.WebElement.Text.ToUpper().Contains(headerText.ToUpper())) { ctrl = c; return(ctrl); } } return(ctrl); }
public static IControl WaitAndFindVisibleElement(By locator) { int i = 0; while (i < TableWaitTime) { ++i; ReadOnlyCollection <IControl> cList = SyncUtilities.FindElements(locator); foreach (Control c in cList) { if (c != null && c.WebElement != null) { //ScrollIntoView(c.WebElement); return(c); } } Thread.Sleep(1000); } return(null); }
public static IControl GetProtocolChkBoxForFormQuestion(string FormName, string QuestionNum, string QuestionPrompt, string ProtocolVer) { try { int ChkBoxIndex = GetProtocolVersionChkBoxIndex(ProtocolVer); if (ChkBoxIndex == 0) { return(null); } IControl row = GetRowOfFormInCreateDatGroupTable(FormName); if (Control_PropertyUtilities.IsControlNull(row)) { return(null); } ReadOnlyCollection <IControl> Checkboxes = SyncUtilities.FindElements(By.XPath("//span[text()='" + FormName + "']/parent::td/parent::tr/following-sibling::tr//span[contains(text(), '" + QuestionNum + "') and contains(text(),'" + QuestionPrompt + "')]/parent::td/following-sibling::td//input")); return(Checkboxes[0]); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(null); }
public static int GetProtocolVersionChkBoxIndex(string ProtocolVer) { try { int counter = 0; ReadOnlyCollection <IControl> headers = SyncUtilities.FindElements(By.XPath("//th//span")); foreach (IControl header in headers) { if (header.WebElement.Text == ProtocolVer) { return(counter); } else { counter++; } } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(0); }