/// <summary> /// gets a list of rows containing the text to find from the row list /// </summary> /// <param name="columnName">the column name</param> /// <param name="textToFind">the text to find</param> /// <returns>list of ProfileHomeScheduledTestsRow</returns> public new List <ProfileHomeScheduledTestsRow> GetsRowsContainingTextToFindFromList(string columnName, string textToFind) { if (RowList.Count == 0) { Assert.Fail("No items were found in the search results column list."); return(null); } else { List <ProfileHomeScheduledTestsRow> assessDashboardScheduledTestsRowList = new List <ProfileHomeScheduledTestsRow>(); string text = null; int index = 0; foreach (var row in RowList) { ProfileHomeScheduledTestsRow assessDashboardScheduledTestsRow = (ProfileHomeScheduledTestsRow)row; if (assessDashboardScheduledTestsRow.Type != GridRowType.Header && assessDashboardScheduledTestsRow.Type != GridRowType.Pagination) { //get the text by column name if (columnName.Equals(ProfileHomeScheduledTestsColumnNames.TestName)) { text = assessDashboardScheduledTestsRow.GetTestName(); } if (columnName.Equals(ProfileHomeScheduledTestsColumnNames.StartDate)) { text = assessDashboardScheduledTestsRow.GetTestStartDate(); } if (columnName.Equals(ProfileHomeScheduledTestsColumnNames.EndDate)) { text = assessDashboardScheduledTestsRow.GetTestEndDate(); } if (columnName.Equals(ProfileHomeScheduledTestsColumnNames.AnswerSheets)) { text = assessDashboardScheduledTestsRow.GetTestAnswerSheetsLinkText(); } //if the text is not null if (text != null) { //if the text contains the text to find if (text.Contains(textToFind)) { assessDashboardScheduledTestsRowList.Add(assessDashboardScheduledTestsRow); } } } } //may return empty row list if text is not found return(assessDashboardScheduledTestsRowList); } }
/// <summary> /// Sets the Rows List /// </summary> public override void SetRowLists() { base.SetRowLists(); int rowIndex = 0; foreach (var webElement in WebElementRows) { Report.Write("GridRow by index: " + rowIndex); GridRowType rowType = GetGridRowType(rowIndex); Report.Write("GridRowType: " + rowType); var lineItem = new ProfileHomeScheduledTestsRow(gridCssSelector, webElement, rowIndex, rowType, ColumnList, ControlPrefix); RowList.Add(lineItem); rowIndex++; } }