public static bool IsStudyAvailableinHomePage(IEnumerable <StudyData> studies) { try { bool isClicked = false; String notificationMessage = "Study has been successfully deleted"; IControl StudiesTable = DS_HomePage.StudiesTable; foreach (StudyData study in studies) { WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList(); searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, study.StudyName, TableColumnContentType.Link)); IControl row = WebTableUtilities.Table_FindRow(DS_HomePage.StudiesTable, searchList, 0); if (!Control_PropertyUtilities.IsControlNull(row)) { IControl cell = WebTableUtilities.GetCell(row, 9); if ((Control_ActionUtilities.MouseClick(cell, String.Empty))) { if (Control_ActionUtilities.ClickModalButton(DS_ConfirmationPopup.DeleteJobsContinue)) { isClicked = DS_BP_NotificationUtilities.VerifyNotificationForDict(notificationMessage); } } } } return(isClicked); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
/*public static bool OpenForm(String eventName, String formName) * { * try * { * ReadOnlyCollection<IControl> rows = GetFormsRowsUnderEvent(eventName); * foreach (IControl row in rows) * { * ReadOnlyCollection<IControl> cells = SyncUtilities.FindVisibleElements_Parent(row.WebElement, By.TagName("td")); * if (cells.Count > 0) * { * IControl crfCell = cells[0]; * IControl crfLink = SyncUtilities.FindVisibleElement_Parent(crfCell.WebElement, By.TagName("a")); * if (!Control_PropertyUtilities.IsControlNull(crfLink)) * { * bool found = false; * String innerText = Control_PropertyUtilities.GetAttributeValue(crfLink, "innertext", out found); * if (found && !String.IsNullOrEmpty(innerText) && innerText.Equals(formName, StringComparison.InvariantCultureIgnoreCase)) * { * return Control_ActionUtilities.Click(crfLink, String.Empty); * } * } * } * } * } * catch (Exception e) * { * } * return false; * }*/ internal static IControl GetFormRow(String eventName, String formName, out IControl crfCell) { crfCell = null; try { ReadOnlyCollection <IControl> rows = GetFormsRowsUnderEvent(eventName); foreach (IControl row in rows) { ReadOnlyCollection <IControl> cells = SyncUtilities.FindVisibleElements_Parent(row.WebElement, By.TagName("td")); if (cells.Count > 0) { crfCell = cells[0]; IControl crfLink = SyncUtilities.FindVisibleElement_Parent(crfCell.WebElement, By.TagName("a")); if (!Control_PropertyUtilities.IsControlNull(crfLink)) { bool found = false; String innerText = Control_PropertyUtilities.GetAttributeValue(crfLink, "innertext", out found); if (found && !String.IsNullOrEmpty(innerText) && innerText.Equals(formName, StringComparison.InvariantCultureIgnoreCase)) { return(row); } } } } } catch (Exception e) { } return(null); }
public static bool AreSitesAvailable(IEnumerable <String> sites) { bool retval = false; try { BrowserUtilities.SwitchToFrame(); List <String> siteList = (List <String>)sites; foreach (String site in siteList) { WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList(); searchList.AddSearchItem(new WebTable_SearchCriteriaItem(0, site, TableColumnContentType.CheckboxAndText)); IControl row = WebTableUtilities.Table_FindRow(DL_AdvancedSearchWindow.SitesTable, searchList, 1); if (Control_PropertyUtilities.IsControlNull(row)) { retval = false; } } retval = true; } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } BrowserUtilities.SwitchToWindow(); return(retval); }
public static IControl GetFormCheckbox(String formName) { try { IControl formsTable = SyncUtilities.FindVisibleElement(By.Id("UnscheduledEvent_chkList")); ReadOnlyCollection <IControl> rows = SyncUtilities.FindVisibleElements_Parent(formsTable.WebElement, By.TagName("tr")); foreach (IControl c in rows) { IControl formLabel = SyncUtilities.FindElement(By.TagName("label")); if (!Control_PropertyUtilities.IsControlNull(formLabel)) { String labelText = Control_PropertyUtilities.GetText(formLabel); if (labelText.Equals(formName, StringComparison.InvariantCultureIgnoreCase)) { return(new Control(c.WebElement.FindElement(By.TagName("input")))); //return SyncUtilities.FindElement(By.TagName("input")); } } } } catch (Exception e) { } return(null); }
static String GetPatientEventKey(IControl eventRow) { try { bool found = false; String rowId = Control_PropertyUtilities.GetAttributeValue(eventRow, "id", out found); if (found && !String.IsNullOrEmpty(rowId)) { String[] values = rowId.Split("_".ToCharArray()); if (values.Length == 2) { String key = values[1]; int i = 0; bool isConverted = int.TryParse(key, out i); if (isConverted) { return(key); } } } } catch (Exception e) { } return(String.Empty); }
public static bool VerifylabsDropDownValues(List <DropDownInfo> dropdownInfoList, String fieldName) { try { List <string> dropdown = new List <string>(); foreach (DropDownInfo dropdownInfo in dropdownInfoList) { dropdown.Add(dropdownInfo.Dropdown); } IControl dropdowncontrol = DS_StudyProperties.LabDropDown; Control_ActionUtilities.Click(dropdowncontrol, "Not able to click on dropdowncontrol"); IControl selectValueInDropdown = DS_StudyProperties.LabDropDownOptions; string selectValue = Control_PropertyUtilities.GetText(selectValueInDropdown); bool found = false; List <String> dropdownvalues = Control_ActionUtilities.Dropdown_GetItems(dropdowncontrol, out found); if (found) { bool comparison = DL_Lab_MRR_Table.AreListsEqual(dropdown, dropdownvalues); } return(true); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool VerifyTheValuesInChangeHistory(string field, string value) { Utilities.BrowserUtilities.SwitchToFrame(); try { if (field.Equals("Lab Name")) { string labName = Control_PropertyUtilities.GetText(DL_Lab_Mrr_AuditHistory.LabNameInChangeHistoryWindow); return(labName.Equals(value)); } else if (field.Equals("Lab TestName")) { string labTestName = Control_PropertyUtilities.GetText(DL_Lab_Mrr_AuditHistory.LabTestNameInChangeHistoryWindow); return(labTestName.Equals(value)); } else if (field.Equals("Heading")) { string heading = Control_PropertyUtilities.GetText(DL_Lab_Mrr_AuditHistory.HeadingInChangeHistoryWindow); return(heading.Equals(value)); } else if (field.Equals("Ref ID")) { string refId = Control_PropertyUtilities.GetText(DL_Lab_Mrr_AuditHistory.RefIDInChangeHistoryWindow); return(refId.Contains(value)); } // Utilities.BrowserUtilities.SwitchToWindow(); } catch (Exception e) { new Reports.DebugLog.DebugLogGenerator().WriteException(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } Utilities.BrowserUtilities.SwitchToWindow(); return(false); }
public static Boolean ValidateMessageOnPage(String message) { try { if (!Control_PropertyUtilities.compareMessage(DL_LabManagementPage.MessageOnLabManagementPage, message)) { Console.WriteLine("Message is not correct. Message on page is:" + DL_LabManagementPage.MessageOnLabManagementPage.WebElement.Text); return(false); } if (DL_LabManagementPage.MessageOnLabManagementPage.WebElement.GetCssValue("color") != "rgba(255, 0, 0, 1)") { Console.WriteLine("Message color is:" + DL_LabManagementPage.MessageOnLabManagementPage.WebElement.GetCssValue("color")); return(false); } if (!Control_PropertyUtilities.CompareCSSValue(DL_LabManagementPage.MessageOnLabManagementPage, "text-align", "center")) { Console.WriteLine("Text is aligned in:" + DL_LabManagementPage.MessageOnLabManagementPage.WebElement.GetCssValue("text-align")); return(false); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(true); }
public static Boolean VerifyAddLabPageInEditMode() { try { foreach (IControl c in DL_AddLabPage.FieldsOnLabPage) { if (!Control_PropertyUtilities.IsEnabled(c)) { return(false); } } if (!Control_PropertyUtilities.IsEnabled(DL_AddLabPage.SaveAndAddAnotherButton)) { return(false); } if (!Control_PropertyUtilities.IsEnabled(DL_AddLabPage.SaveButton)) { return(false); } if (!Control_PropertyUtilities.IsEnabled(DL_AddLabPage.CancelButton)) { return(false); } if (!Control_PropertyUtilities.IsEnabled(DL_AddLabPage.SaveAndAssociateSiteButton)) { return(false); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(true); }
public static bool SelectePatients(List <SiteManagementMigratePatientsData> patients) { bool isSuccess = false; try { foreach (SiteManagementMigratePatientsData patient in patients) { WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList(); list.AddSearchItem(new WebTable_SearchCriteriaItem(0, patient.PatientID, TableColumnContentType.Text)); IControl patientRow = WebTableUtilities.Table_FindRow(DL_MigratePatientsPage.PatientsTable, list, 0); IControl checkboxCell = WebTableUtilities.GetCell(patientRow, 2); IControl checkbox = WebTableUtilities.GetInputControl(checkboxCell); bool found = false; String propValue = Control_PropertyUtilities.GetAttributeValue(checkbox, "checked", out found); if (!found) { isSuccess = Control_ActionUtilities.Click(checkbox, String.Empty); } } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(isSuccess); }
public static bool SelectForms(List <UnschedueledEventFormsData> dataList) { try { foreach (UnschedueledEventFormsData data in dataList) { IControl formCheckbox = DL_AddUnscheduledEventStep2Page.GetFormCheckbox(data.FormName); if (!Control_PropertyUtilities.IsControlNull(formCheckbox)) { if (!Control_ActionUtilities.CheckCheckbox(formCheckbox)) { return(false); } } else { return(false); } } return(true); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
static IControl GetFormRadioButtonForFlag(List <IControl> eventFormRows, String formName, String radioButtonName) { foreach (IControl formRow in eventFormRows) { ReadOnlyCollection <IControl> cells = SyncUtilities.FindVisibleElements_Parent(formRow.WebElement, By.TagName("td")); if (cells.Count > 6) { if (formName.Equals(Control_PropertyUtilities.GetText(cells[0]), StringComparison.InvariantCultureIgnoreCase)) { if (radioButtonName.Equals("No Change", StringComparison.InvariantCultureIgnoreCase)) { return(SyncUtilities.FindVisibleElement_Parent(cells[2].WebElement, By.TagName("input"))); } else if (radioButtonName.Equals("Mark Required", StringComparison.InvariantCultureIgnoreCase)) { return(SyncUtilities.FindVisibleElement_Parent(cells[3].WebElement, By.TagName("input"))); } else if (radioButtonName.Equals("Mark All", StringComparison.InvariantCultureIgnoreCase)) { return(SyncUtilities.FindVisibleElement_Parent(cells[4].WebElement, By.TagName("input"))); } else if (radioButtonName.Equals("Unmark All", StringComparison.InvariantCultureIgnoreCase)) { return(SyncUtilities.FindVisibleElement_Parent(cells[5].WebElement, By.TagName("input"))); } } } } return(null); }
static List <IControl> GetEventFormRowsForFlag(ReadOnlyCollection <IControl> tableRows, String eventName) { List <IControl> eventFormRows = new List <IControl>(); try { bool isEventMatched = false; foreach (IControl row in tableRows) { IControl eventNameLabel = null; if (IsEventRowForFlag(row, eventName, out eventNameLabel)) { String actualEventNameOld = Control_PropertyUtilities.GetText(eventNameLabel); String actualEventNameNew = actualEventNameOld.Replace("(Select all in event)", ""); isEventMatched = eventName.Equals(actualEventNameNew.Trim(), StringComparison.InvariantCultureIgnoreCase); } else { if (isEventMatched) { IControl formRow = SyncUtilities.FindVisibleElement_Parent(row.WebElement, By.TagName("span")); if (!Control_PropertyUtilities.IsControlNull(formRow)) { eventFormRows.Add(row); } } } } return(eventFormRows); } catch (Exception e) { } return(eventFormRows); }
public static bool ExpandFlagsPalette() { try { IControl expandCollapseIcon = DL_EditDCFPage.DCF_FlagsPaletteCollaseExpandIcon; bool found = false; String src = Control_PropertyUtilities.GetAttributeValue(expandCollapseIcon, "src", out found); if (found) { if (src.Contains("menuDown")) { return(Control_ActionUtilities.Click(expandCollapseIcon, String.Empty)); } else { return(true); } } else { return(false); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
protected static void NavigateToPage(IControl tableHost, int rowNumber) { try { if (rowNumber > 0) { int rowsPerPage = 15; int pageNumber = ((rowNumber - 1) / rowsPerPage) + 1; IControl paginationControl = SyncUtilities.FindVisibleElement_Parent(tableHost.WebElement, By.ClassName("pagination")); String pageTitle = "li[title='Page :" + pageNumber + "']"; IControl pageLi = SyncUtilities.FindVisibleElement_Parent(paginationControl.WebElement, By.CssSelector(pageTitle)); if (!Control_PropertyUtilities.IsControlNull(pageLi)) { IControl pageNumberControl = SyncUtilities.FindElement_Parent(pageLi.WebElement, By.TagName("a")); if (!Control_PropertyUtilities.IsControlNull(pageNumberControl)) { Control_ActionUtilities.Click(pageLi, String.Empty); } } } } catch (Exception e) { } }
public void ThenISeeLabPageInViewMode() { if (!Control_PropertyUtilities.IsControlDisabled(DL_AddLabPage.SaveButton)) { ScenarioContext.Current["ActResult"] = "Failed"; } }
public static bool IsTableHistoryIconAvailable_WithoutWait(String tableName) { try { IControl tableNameHost = null; IControl tableHost = GetTableHost(tableName, 0, out tableNameHost); if (tableHost != null && tableNameHost != null && tableNameHost.WebElement != null) { ReadOnlyCollection <IControl> images = SyncUtilities.FindElements_Parent(tableNameHost.WebElement, By.TagName("img")); foreach (IControl image in images) { bool found = false; String imageSrc = Control_PropertyUtilities.GetAttributeValue(image, "src", out found); if (found && imageSrc.EndsWith("changeHistory.gif")) { return(true); } } } } catch (Exception e) { } return(false); }
public static bool IsStudyAvailable(IEnumerable <StudyData> studies) { try { IControl StudiesTable = DS_HomePage.StudiesTableInCreateStudyFromExistingStudyWindow; foreach (StudyData study in studies) { WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList(); searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, study.StudyName, TableColumnContentType.Link)); IControl row = WebTableUtilities.Table_FindRow(StudiesTable, searchList, 0); if (Control_PropertyUtilities.IsControlNull(row)) { return(false); } IControl cell = WebTableUtilities.GetCell(row, 1); IControl link = WebTableUtilities.GetLink(cell); Control_ActionUtilities.Click(link, "linknotfound"); } return(true); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
static bool IsDataMatched(Mrr_ChangeHistoryData data, IControl historyRow) { try { IControl dateTimeCell = DL_Lab_Mrr_AuditHistory.GetDateTimeCell_Row(historyRow); IControl referenceRangeCell = DL_Lab_Mrr_AuditHistory.GetReferenceRangeCell_Row(historyRow); IControl actionCell = DL_Lab_Mrr_AuditHistory.GetActionCell_Row(historyRow); String dateTimeText = Control_PropertyUtilities.GetText(dateTimeCell); dateTimeText.Trim(); String referenceRangeText = Control_PropertyUtilities.GetText(referenceRangeCell); referenceRangeText.Trim(); String actionText = Control_PropertyUtilities.GetText(actionCell); if (!dateTimeText.Contains(data.DateTime.Replace("\\r", "\r"))) { return(false); } if (!referenceRangeText.Equals(data.ReferenceRange.Replace("\\r", "\r"), StringComparison.InvariantCultureIgnoreCase)) { return(false); } if (!actionText.Equals(data.Action, StringComparison.InvariantCultureIgnoreCase)) { return(false); } return(true); } catch (Exception e) { } return(false); }
public static bool VerifyDCF(CRF_DCFTabData data) { bool retVal = false; int i = 0; try { while (retVal || i < 120) { ++i; IControl row = GetRowFromActiveDCFsSubTab(data); retVal = !Control_PropertyUtilities.IsControlNull(row); Thread.Sleep(1000); if (!retVal) { BrowserUtilities.RefreshPage(); BP_FormUtilities.OpenMainTabInForm("DCFs"); OpenSubTabUnderDCFTab("All"); } else { return(retVal); } } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(retVal); }
public static bool EnterReason(String reason) { try { bool retVal = false; BrowserUtilities.SwitchToFrame(); try { IControl modalHeaderLabel = DL_ModalWindow_ResetCRF.TitleLabel_Step2; if (!Control_PropertyUtilities.IsControlNull(modalHeaderLabel)) { String headerText = Control_PropertyUtilities.GetText(modalHeaderLabel); if (headerText.Equals("Reset Form", StringComparison.InvariantCultureIgnoreCase)) { retVal = Control_ActionUtilities.Textbox_SetText(DL_ModalWindow_ResetCRF.ReasonTextArea, reason, String.Empty); } } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } BrowserUtilities.SwitchToWindow(); return(retVal); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static IControl GetImageControl(IControl host, string imageName) { try { System.Collections.ObjectModel.ReadOnlyCollection <IControl> cc = SyncUtilities.FindVisibleElements_Parent(host.WebElement, By.TagName("image")); List <IControl> imageList = SyncUtilities.FindVisibleElements_Parent(host.WebElement, By.TagName("input")).ToList <IControl>(); if (imageName.Equals("SaveAnd")) { foreach (IControl image in imageList) { bool found; String imageProp = Control_PropertyUtilities.GetAttributeValue(image, "id", out found); if (found) { if (imageProp.EndsWith("btnSaveAdd")) { return(image); } } } return(null); } else if (imageName.Equals("Save")) { foreach (IControl image in imageList) { bool found; String imageProp = Control_PropertyUtilities.GetAttributeValue(image, "id", out found); if (found) { if (imageProp.EndsWith("btnSave")) { return(image); } } } return(null); } else if (imageName.Equals("Cancel")) { foreach (IControl image in imageList) { bool found; String imageProp = Control_PropertyUtilities.GetAttributeValue(image, "id", out found); if (found) { if (imageProp.EndsWith("btnCancel")) { return(image); } } } return(null); } } catch (Exception e) { } return(null); }
public static bool CollapseEvent(String eventName, out String patientEventKey) { patientEventKey = String.Empty; try { int i = 0; while (i < 5) { IControl eventExpandCollapseImage = GetEventExpandCollapseImage(eventName, out patientEventKey); if (eventExpandCollapseImage != null && eventExpandCollapseImage.WebElement != null) { bool found = false; String prop_SRC = Control_PropertyUtilities.GetAttributeValue(eventExpandCollapseImage, "src", out found); if (found && prop_SRC.Contains("menu_collapse.gif")) { Control_ActionUtilities.Click(eventExpandCollapseImage, String.Empty); } else if (found && prop_SRC.Contains("menu_expand.gif")) { return(true); } } Thread.Sleep(2000); ++i; } } catch (Exception e) { } return(false); }
public static bool IsLinkAvailable(String linkName) { try { if (linkName.Equals("Quick Export", StringComparison.InvariantCultureIgnoreCase)) { IControl c = DL_ExportPage.QuickExportLink; return(!Control_PropertyUtilities.IsControlNull(c)); } else if (linkName.Equals("Archive Export", StringComparison.InvariantCultureIgnoreCase)) { IControl c = DL_ExportPage.ArchiveExportLink; return(!Control_PropertyUtilities.IsControlNull(c)); } else if (linkName.Equals("Advanced Export", StringComparison.InvariantCultureIgnoreCase)) { IControl c = DL_ExportPage.AdvancedExportLink; return(!Control_PropertyUtilities.IsControlNull(c)); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool ExpandAllEvents() { try { IControl expandCollapseAllIcon = SyncUtilities.FindVisibleElement(By.Id("imgExpandAll")); bool found = false; String src = Control_PropertyUtilities.GetAttributeValue(expandCollapseAllIcon, "src", out found); if (found) { if (src.Contains("menu_collapse")) { Control_ActionUtilities.Click(expandCollapseAllIcon, String.Empty); } Control_ActionUtilities.Click(expandCollapseAllIcon, String.Empty); } IControl expandCollapseAllIcon1 = SyncUtilities.FindVisibleElement(By.Id("imgExpandAll")); bool found1 = false; String src1 = Control_PropertyUtilities.GetAttributeValue(expandCollapseAllIcon, "src", out found1); if (found1) { return(src1.Contains("menu_collapse")); } } catch (Exception e) { } return(false); }
public static bool VerifyJobStatus(String process, String expectedStatus) { int i = 0; bool found = false; try { while (i < 60 && !found) { BrowserUtilities.RefreshPage(); IControl cell = GetStatusCell(process, expectedStatus); if (!Control_PropertyUtilities.IsControlNull(cell)) { String actualText = Control_PropertyUtilities.GetText(cell); found = actualText.Equals(expectedStatus, StringComparison.InvariantCultureIgnoreCase); } Thread.Sleep(5000); ++i; } } catch (Exception e) { } return(found); }
public static bool SelectDerivationByDerivationNameFilter(string derivationName) { try { Control_ActionUtilities.Click(DL_DerivationManagement.derivationNameTextBoxFilter, "Unable to select the filter icon"); Thread.Sleep(2000); Control_ActionUtilities.Click(DL_DerivationManagement.FilterTypeLink("NoFilter"), "Unable to select the Nofilter icon"); Thread.Sleep(2000); Control_ActionUtilities.Textbox_SetText(DL_DerivationManagement.derivationNameTextBox, derivationName, "unable to set the derivation name - " + derivationName + "in the derivation name textbox"); Thread.Sleep(5000); if (!Control_PropertyUtilities.IsControlNull(DL_DerivationManagement.derivationNameLink(derivationName))) { if (!Control_ActionUtilities.Click(DL_DerivationManagement.derivationNameLink(derivationName), "Unable to select the link - " + derivationName)) { return(false); } else { return(true); } } return(false); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static IControl GetCollapsedTableRow(String tableName, int rowNumber) { IControl tableNameHost = null; IControl tableHost = GetTableHost(tableName, rowNumber, out tableNameHost); IReadOnlyCollection <IControl> rows = SyncUtilities.FindElements_Parent(tableHost.WebElement, By.ClassName("HeaderRowOff")); foreach (IControl row in rows) { IReadOnlyCollection <IControl> cells = SyncUtilities.FindElements_Parent(row.WebElement, By.ClassName("tdCollapseRowNum")); foreach (IControl cell in cells) { String cellText = Control_PropertyUtilities.GetText(cell); if (cellText.EndsWith("." + rowNumber + ".")) { if (Control_ActionUtilities.IsClickable(row.WebElement)) { return(row); } else { return(null); } } } } return(null); }
public static bool ExpandSearchPalette() { try { IControl c = DL_DCFs_SearchPalette.SearchPalette_ExpandCollapseIcon; bool found = false; String imageSource = Control_PropertyUtilities.GetAttributeValue(c, "src", out found); if (found) { if (imageSource.Contains("menuDown")) { return(Control_ActionUtilities.Click(c, String.Empty)); } else { return(true); } } else { return(false); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool ExpandEvent(String eventName, out String identifier) { identifier = String.Empty; try { ReadOnlyCollection <IControl> rows = WebTableUtilities.GetRows(DL_CRF_PDEP_EventsPage.EventsTable); foreach (IControl row in rows) { if (Control_PropertyUtilities.IsControlVisible(row)) { IControl cell = WebTableUtilities.GetCell(row, 0); if (Control_PropertyUtilities.GetText(cell).Equals(eventName, StringComparison.InvariantCultureIgnoreCase)) { IControl expandCollapseImage = WebTableUtilities.GetElement(row, String.Empty, 0, TableColumnContentType.Image); bool found = false; String imageSource = Control_PropertyUtilities.GetAttributeValue(expandCollapseImage, "src", out found); if (found) { identifier = Control_PropertyUtilities.GetAttributeValue(row, "identifier", out found); if (imageSource.Contains("menu_expand.gif")) { return(Control_ActionUtilities.Click(expandCollapseImage, String.Empty)); } return(imageSource.Contains("menu_collapse.gif")); } } } } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }