public static bool DeleteTheRecordUsingDeleteIcon(string refID, string action) { try { DL_Lab_MRR_Table.NavigateToFirstPage(DL_Lab_MRR_Table.Pager); do { WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList(); searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, refID, TableColumnContentType.Text)); IControl row = WebTableUtilities.Table_FindRow(DL_Lab_MRR_Table.MrrTable, searchList, 0); if (!Control_PropertyUtilities.IsControlNull(row)) { IControl actionsCell = WebTableUtilities.GetCell(row, 13); IControl icon = DL_Lab_MRR_Table.GetActionIcon(actionsCell, action); return(Control_ActionUtilities.Click(icon, String.Empty)); } }while (DL_Lab_MRR_Table.NavigateToNextPage(DL_Lab_MRR_Table.Pager)); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool VeifyTheIconsForTheDeletedRecords(string refID, string action) { try { DL_Lab_MRR_Table.NavigateToFirstPage(DL_Lab_MRR_Table.Pager); do { WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList(); searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, refID, TableColumnContentType.Text)); IControl row = WebTableUtilities.Table_FindRow(DL_Lab_MRR_Table.MrrTable, searchList, 0); if (!Control_PropertyUtilities.IsControlNull(row)) { IControl actionsCell = WebTableUtilities.GetCell(row, 13); IControl icon = DL_Lab_MRR_Table.GetActionIcon(actionsCell, action); if (action.Equals("Edit") || action.Equals("Delete")) { return(Control_PropertyUtilities.IsControlNull(icon)); } else if (action.Equals("History") || action.Equals("Copy")) { return(Control_PropertyUtilities.IsEnabled(icon)); } } }while (DL_Lab_MRR_Table.NavigateToNextPage(DL_Lab_MRR_Table.Pager)); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool IsDateDataInSortOrder(String sortOrder, String columnName) { try { List <String> valueList = DL_Lab_MRR_Table.GetValuesInColumn(columnName); List <DateTime> datesFromApp = GetCopyListofDateValues(valueList); List <DateTime> copyValueList = GetCopyListofDateValues(valueList); if (sortOrder.Equals("Ascending", StringComparison.InvariantCultureIgnoreCase)) { List <DateTime> sortedDates = copyValueList.OrderByDescending(c => c).ToList(); return(AreListsDatesEqual(datesFromApp, sortedDates)); } else if (sortOrder.Equals("Descending", StringComparison.InvariantCultureIgnoreCase)) { List <DateTime> sortedDates = copyValueList.OrderByDescending(c => c).ToList(); sortedDates.Reverse(); return(AreListsDatesEqual(datesFromApp, sortedDates)); } else { return(false); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool VeifyTheStrikeThroughRecords(string refID) { try { bool recordFoundInStrikeThroughMode = false; DL_Lab_MRR_Table.NavigateToFirstPage(DL_Lab_MRR_Table.Pager); do { WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList(); searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, refID, TableColumnContentType.Text)); IControl row = WebTableUtilities.Table_FindRow(DL_Lab_MRR_Table.MrrTable, searchList, 0); if (!Control_PropertyUtilities.IsControlNull(row)) { IControl strikedRow = DL_Lab_Mrr_Delete.StrikeThroughRow; IControl checkboxForDeletedRecord = DL_Lab_Mrr_Delete.Checkbox(row); if (Control_PropertyUtilities.IsControlNull(strikedRow) && Control_PropertyUtilities.IsControlNull(checkboxForDeletedRecord)) { recordFoundInStrikeThroughMode = true; } } }while (DL_Lab_MRR_Table.NavigateToNextPage(DL_Lab_MRR_Table.Pager)); return(recordFoundInStrikeThroughMode); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool IsDataInSortOrderFor(String sortOrder, String columnName) { try { List <String> valueList = DL_Lab_MRR_Table.GetValuesInColumn(columnName); List <String> copyValueList = GetCopyList(valueList); copyValueList.Sort(); if (sortOrder.Equals("Ascending", StringComparison.InvariantCultureIgnoreCase)) { return(AreListsEqual(valueList, copyValueList)); } else if (sortOrder.Equals("Descending", StringComparison.InvariantCultureIgnoreCase)) { copyValueList.Sort(); copyValueList.Reverse(); return(AreListsEqual(valueList, copyValueList)); } else { return(false); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool VerifyValuesInDropdown(List <DropDownInfo> dropdownInfoList, String fieldName) { try { List <string> dropdown = new List <string>(); foreach (DropDownInfo dropdownInfo in dropdownInfoList) { dropdown.Add(dropdownInfo.Dropdown); } IControl dropdowncontrol = DL_Lab_MRR_Table.GetDropdownInvoker(fieldName); Control_ActionUtilities.Click(dropdowncontrol, "Not able to click on dropdowncontrol"); IControl selectValueInDropdown = DL_Lab_MRR_Table.GetSelectValueFromDropdown; string selectValue = Control_PropertyUtilities.GetText(selectValueInDropdown); ReadOnlyCollection <IControl> dropdowncontrollist = DL_Lab_MRR_Table.GetDropdownItems(); List <string> dropdownvalues = new List <string>(); // dropdownvalues.Add(selectValue); foreach (IControl control in dropdowncontrollist) { string dropdownvalue = Control_PropertyUtilities.GetText(control); dropdownvalues.Add(dropdownvalue); } bool comparison = DL_Lab_MRR_Table.AreListsEqual(dropdown, dropdownvalues); return(comparison); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool RecordsVerificationForCancel(string refID) { try { bool recordFound = false; DL_Lab_MRR_Table.NavigateToFirstPage(DL_Lab_MRR_Table.Pager); do { WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList(); searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, refID, TableColumnContentType.Text)); IControl row = WebTableUtilities.Table_FindRow(DL_Lab_MRR_Table.MrrTable, searchList, 0); if (!Control_PropertyUtilities.IsControlNull(row)) { recordFound = true; } }while (DL_Lab_MRR_Table.NavigateToNextPage(DL_Lab_MRR_Table.Pager)); return(recordFound); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
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 ApplyFilterForSubHeading(String columnName, String filterText, String filterCriteria, int occurence) { try { IControl filterIcon = DL_Lab_MRR_Table.GetColumnFilterLinkForSubColumns(columnName, occurence); Control_ActionUtilities.Click(filterIcon, String.Empty); //Control_ActionUtilities.Click(filterIcon, String.Empty); Control_ActionUtilities.Click(DL_Lab_MRR_Table.FilterDropDownIcon, String.Empty); IControl filterCriteriaItem = DL_Lab_MRR_Table.GetActiveFilterItem(filterCriteria); Control_ActionUtilities.Click(filterCriteriaItem, String.Empty); IControl filterTextbox = DL_Lab_MRR_Table.FilterTextBox; Control_ActionUtilities.Textbox_SetText(filterTextbox, filterText, String.Empty); IControl filterButton = DL_Lab_MRR_Table.FilterButton; Control_ActionUtilities.Click(filterButton, String.Empty); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); return(false); } return(true); }
public static string ReadtheRefID() { DL_Lab_MRR_Table.NavigateToLastPage(DL_Lab_MRR_Table.Pager); System.Collections.ObjectModel.ReadOnlyCollection <IControl> rows = null; int rowCount = WebTableUtilities.GetRowCount(DL_Lab_MRR_Table.MrrTable, out rows); string refID = WebTableUtilities.GetValue(DL_Lab_MRR_Table.MrrTable, rowCount - 1, 1); return(refID); }
public static bool ClickOnColumnHeader(String columnName) { //IControl columnNameLink = WebTableUtilities.GetColumnHeader(DL_Lab_MRR_Table.MrrTableGridTitleRow, columnName, TableColumnContentType.Link); IControl columnNameLink = DL_Lab_MRR_Table.GetColumnHeaderTitle_FirstRow(columnName); if (columnNameLink != null) { return(Control_ActionUtilities.Click(columnNameLink, String.Empty)); } return(false); }
public static bool ApplyFilter(String columnName, string filterText, String filterCriteria) { try { IControl filterIcon = DL_Lab_MRR_Table_Changes.GetColumnFilterLink(columnName); bool isFilterIconClicked = Control_ActionUtilities.Click(filterIcon, String.Empty); bool isDropdownClicked = Control_ActionUtilities.Click(DL_Lab_MRR_Table.FilterDropDownIcon, String.Empty); IControl filterCriteriaItem = DL_Lab_MRR_Table.GetActiveFilterItem(filterCriteria); if ((Control_PropertyUtilities.GetText(filterCriteriaItem)).Equals(filterCriteria)) { bool isFilterCriteriaClicked = Control_ActionUtilities.Click(filterCriteriaItem, String.Empty); } IControl filterTextbox; if (columnName.Equals("Ref ID") || columnName.Equals("From Age") || columnName.Equals("To Age")) { filterTextbox = DL_Lab_MRR_Table.FilterTextBox; if (filterTextbox != null) { bool isFilterTextSet = Control_ActionUtilities.Textbox_SetText1(filterTextbox, filterText, String.Empty); IControl filterButton = DL_Lab_MRR_Table.FilterButton; Control_ActionUtilities.Click(filterButton, String.Empty); } } else if (columnName.Equals("Gender")) { filterTextbox = DL_Lab_MRR_Table.FilterTextBox; Control_ActionUtilities.Textbox_SetText(filterTextbox, filterText, String.Empty); IControl filterButton = DL_Lab_MRR_Table.FilterButton; Control_ActionUtilities.Click(filterButton, String.Empty); } else if (columnName.Equals("Start Date") || columnName.Equals("End Date")) { filterTextbox = DL_Lab_MRR_Table_Changes.FilterTextBoxForDateInputFieldInMRRTable; Control_ActionUtilities.Textbox_SetText1(filterTextbox, filterText, String.Empty); System.Threading.Thread.Sleep(1000); IControl filterButton = DL_Lab_MRR_Table.FilterButton; string filterbutton = Control_PropertyUtilities.GetText(filterButton); System.Threading.Thread.Sleep(3000); Control_ActionUtilities.Click(filterButton, String.Empty); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); return(false); } return(true); }
public static bool IsDataInSortOrder(String sortOrder, String columnName) { try { List <String> valueList = DL_Lab_MRR_Table.GetValuesInColumn(columnName); List <int> fromAgeNumbersListOnly = new List <int>(); foreach (var v in valueList) { var splittedValues = v.Split(new char[] { ' ' }); if (splittedValues.Length == 2) { fromAgeNumbersListOnly.Add(int.Parse(splittedValues[0])); } else if (splittedValues.Length == 3) { fromAgeNumbersListOnly.Add(int.Parse(splittedValues[1])); } } //List<String> copyValueList = GetCopyList(valueList); //copyValueList.ToArray(); var originalList = fromAgeNumbersListOnly.Select(p => p).ToList(); fromAgeNumbersListOnly.Sort(); // string[] s = copyValueList.ToArray(); if (sortOrder.Equals("Ascending", StringComparison.InvariantCultureIgnoreCase)) { //return AreListsEqual(valueList, copyValueList); return(originalList.SequenceEqual(fromAgeNumbersListOnly)); //return AreListsEqual(originalList, fromAgeNumbersListOnly); } else if (sortOrder.Equals("Descending", StringComparison.InvariantCultureIgnoreCase)) { fromAgeNumbersListOnly.Reverse(); return(originalList.SequenceEqual(fromAgeNumbersListOnly)); //copyValueList.Sort(); //copyValueList.Reverse(); //return AreListsEqual(valueList, copyValueList); } else { return(false); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
static IControl FindLabRow(String labId) { DL_Lab_MRR_Table.NavigateToFirstPage(DL_Lab_MRR_Table.Pager); do { IControl labRow = FindRow(labId); if (labRow != null) { return(labRow); } }while (DL_Lab_MRR_Table.NavigateToNextPage(DL_Lab_MRR_Table.Pager)); return(null); }
public static bool GetFirstRowFromTableAndClickOnAction(string action) { try { if (DL_Lab_MRR_Table.IsInReferenceRangePage()) { IControl actionsCell = WebTableUtilities.GetCell(DL_Lab_MRR_Table.GetFirstRow, 13); IControl icon = DL_Lab_MRR_Table.GetActionIcon(actionsCell, action); return(Control_ActionUtilities.Click(icon, String.Empty)); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool VerifyTheDefaultValueInInputField(string value, String fieldName) { try { IControl dropdowncontrol = DL_Lab_MRR_Table.GetDropdownInvoker(fieldName); string dropdownvalue = Control_PropertyUtilities.GetText(dropdowncontrol); if (value.Equals(dropdownvalue)) { return(true); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
public static bool ClearFilterForSubColumns(String columnName, int occurence) { try { IControl filterIcon = DL_Lab_MRR_Table.GetColumnFilterLinkForSubColumns(columnName, occurence); Control_ActionUtilities.Click(filterIcon, String.Empty); IControl clearIcon = DL_Lab_MRR_Table.ClearButton; Control_ActionUtilities.Click(clearIcon, String.Empty); } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); return(false); } return(true); }
public static bool ActionIconsInViewMode(string action) { try { IControl actionsCell = WebTableUtilities.GetCell(DL_Lab_MRR_Table.GetFirstRow, 13); IControl icon = DL_Lab_MRR_Table.GetActionIcon(actionsCell, action); if (action.Equals("Edit") || action.Equals("Copy") || action.Equals("Delete")) { return(Control_PropertyUtilities.IsControlNull(icon)); } else if (action.Equals("History")) { return(Control_PropertyUtilities.IsEnabled(icon)); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }
//public static bool ClearFilter(String columnName) //{ // try // { // IControl filterClearButton = WebTableUtilities.GetClearFilterButton(DL_Lab_ManageReferenceRanges.LabsGridFilterRow, GetColumnIndex(columnName)); // Control_ActionUtilities.Click(filterClearButton, String.Empty); // } // catch (Exception e) // { // new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); // return false; // } // return true; //} public static bool IsDataFilteredForAge(String columnName, String filterText, String filterCriteria) { return(IsFilterCriteriaMatchedInMRRTableGridForAge(DL_Lab_MRR_Table.GetValuesInColumn(columnName), filterText, filterCriteria)); }
public static bool IsDataFiltered(String columnName, String filterText, String filterCriteria, int occurence) { return(StringComparisonUtilities.IsFilterCriteriaMatched(DL_Lab_MRR_Table.GetValuesInColumn(columnName, occurence), filterText, filterCriteria)); }
public static bool IsDataInSortOrder(String sortOrder, String columnName, String range) { try { List <String> valueList = DL_Lab_MRR_Table.GetValuesInColumn(columnName, range); List <int> fromAgeNumbersListOnly = new List <int>(); foreach (var v in valueList) { var splittedValues = v.Split(new char[] { ' ' }); if (splittedValues.Length == 2) { fromAgeNumbersListOnly.Add(int.Parse(splittedValues[1])); } else if (splittedValues.Length == 3) { fromAgeNumbersListOnly.Add(int.Parse(splittedValues[1])); } else if (splittedValues.Length == 1) { fromAgeNumbersListOnly.Add(int.Parse(splittedValues[0])); } } var originalList = fromAgeNumbersListOnly.Select(p => p).ToList(); fromAgeNumbersListOnly.Sort(); //List<String> copyValueList = GetCopyList(valueList); //List <String> list = new List<String>(); ////var sorted = from element in copyValueList //// orderby element //// select element; //List<int> rangeValues = new List<int>(); //foreach (String s1 in copyValueList) //{ // var sorted = from element in copyValueList // orderby element // select element; // //list.Add(sorted); // var var1 = copyValueList.OrderByDescending(s2 => int.Parse(s1.Split('>')[0])).ToList(); //} ////foreach (var element in sorted) ////{ //// Console.WriteLine(element); ////} //foreach (String s1 in copyValueList) //{ // rangeValues.Add(int.Parse(s1)); //} if (sortOrder.Equals("Ascending", StringComparison.InvariantCultureIgnoreCase)) { //List<String> list1 = valueList.OrderByDescending(c => c).ToList(); //List<String> addTheCharacters = new List<String>(); //rangeValues.Sort(); //if(columnName.Equals("Low")) //{ // foreach(int i1 in rangeValues) // { // addTheCharacters.Add("> " + i1); // } //} //else if (columnName.Equals("High")) //{ // foreach (int i1 in rangeValues) // { // addTheCharacters.Add("< " + i1); // } //} //return AreListsEqual(valueList, addTheCharacters); return(originalList.SequenceEqual(fromAgeNumbersListOnly)); } else if (sortOrder.Equals("Descending", StringComparison.InvariantCultureIgnoreCase)) { fromAgeNumbersListOnly.Reverse(); return(originalList.SequenceEqual(fromAgeNumbersListOnly)); //copyValueList.Sort(); //copyValueList.Reverse(); //List<String> addTheCharacters = new List<String>(); //if (range.Equals("Low")) //{ // foreach (int i1 in rangeValues) // { // addTheCharacters.Add("> " + i1); // } //} //else if (range.Equals("High")) //{ // foreach (int i1 in rangeValues) // { // addTheCharacters.Add("< " + i1); // } //} //return AreListsEqual(valueList, copyValueList); } else { return(false); } } catch (Exception e) { new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } return(false); }