public T GetTableElement <T>(FindRow findRow, string targetCellText) where T : ElementSe { TableRowSe row = FindRow(findRow); TableCellSe cell = row.Cells.Find(i => i.Text.Contains(targetCellText)); string tag = new ElementSe(cell).ConvertTo <T>().ElementTag; ElementSe element = new ElementSe(cell, By.TagName(tag)); return(element.ConvertTo <T>()); }
private void InitializeCells() { TableCellSeCollection theCells = new TableCellSeCollection(WebElement, By.TagName("td")); foreach (var cell in theCells) { TableCellSe temp = new TableCellSe(cell); Cells.Add(temp); } }
public List <string> GetAllValuesFromColumn(int columnIndex) { List <string> values = new List <string>(); foreach (var row in Rows) { if (row.Style.ToLower() != "none") { TableCellSe cell = row.Cells[columnIndex]; if (!string.IsNullOrEmpty(cell.Text)) { values.Add(cell.Text); } } } return(values); }
public List <string> GetAllValuesFromColumn(int columnIndex, string className) { List <string> values = new List <string>(); foreach (var row in Rows) { if (row.Style.ToLower() != "none") { TableCellSe cell = row.Cells[columnIndex]; ElementSe element = cell.Div(e => e.ClassName == className).ConvertTo <ElementSe>(); if (element.Exists) { string s = element.Text; if (!string.IsNullOrEmpty(s)) { values.Add(s); } } } } return(values); }