/// <summary> /// Sets the Rows List /// </summary> public override void SetRowLists() { base.SetRowLists(); int rowIndex = 0; for (int i = 0; i < WebElementRows.Count; i++) { Report.Write("GridRow by index: " + rowIndex); //GridRowType rowType = GetGridRowType(rowIndex); GridRowType rowType = GridRowType.Data; if (i == 0) { rowType = GridRowType.Header; } bool lastRow = false; if (i == WebElementRows.Count - 1) { lastRow = true; } Report.Write("GridRowType: " + rowType); var lineItem = new BenchmarkTestsTabOneTestViewRow(gridCssSelector, WebElementRows[i], rowIndex, rowType, lastRow, ColumnList, ControlPrefix); RowList.Add(lineItem); rowIndex++; } }
/// <summary> /// click on view link for an item /// specified the item number through dataObject /// </summary> public BenchmarkTestsTab GridSelectItemView() { int itemNumber = Convert.ToInt32(Data.ItemNumber); Grid.SetGridLists(); BenchmarkTestsTabOneTestViewRow found = Grid.GetsRow(itemNumber); if (found != null) { Report.Write("Attempting to click on view for item " + itemNumber); found.SelectColumn(BenchmarkTestsTabOneTestViewColumnNames.ItemNumber); } return(new BenchmarkTestsTabItemResponseView()); }
/// <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 GridRow</returns> public new List <BenchmarkTestsTabOneTestViewRow> GetsRowsContainingTextToFindFromList(string columnName, string textToFind) { if (RowList.Count == 0) {//changed to debug for test cases where we want to assert that no search results were found Report.Write("No items were found in the search results column list."); return(null); } else { List <BenchmarkTestsTabOneTestViewRow> rowList = new List <BenchmarkTestsTabOneTestViewRow>(); string text = null; int index = 0; //last row is not part of the grid. so use count - 1 to disclude it. for (int i = 0; i < RowList.Count - 1; i++) { if (RowList[i].Type == GridRowType.Data) { BenchmarkTestsTabOneTestViewRow BenchmarkTestsTabOneTestViewRow = (BenchmarkTestsTabOneTestViewRow)RowList[i]; if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { BenchmarkTestsTabOneTestViewRow.FakeText = textToFind; } //get the text by column name if (columnName.Equals(BenchmarkTestsTabOneTestViewColumnNames.TestName)) { text = BenchmarkTestsTabOneTestViewRow.GetTestName(); //Debug.WriteLine("actual text: " + text); //Debug.WriteLine("expected text to find: " + textToFind); } //if the text is not null if (text != null) { //if the text contains the text to find if (text.Contains(textToFind)) { rowList.Add(BenchmarkTestsTabOneTestViewRow); } } } } //may return empty row list if text is not found return(rowList); } }