예제 #1
0
        /// <summary>
        /// Finds the first cell tha matches the provided search value.
        /// </summary>
        /// <param name="elementScope">The element scope to start at (usually a TableRow or Table).</param>
        /// <param name="searchValue">The value to search for.</param>
        /// <returns>The first cell that matches the specified search value (case sensitive). If no cell is found, returns null.</returns>
        public static SnapshotElementScope FindCell(this ElementScope elementScope, string searchValue)
        {
            var cells = elementScope.FindAllCells();

            return(cells.FirstOrDefault(c => c.Text == searchValue));
        }
예제 #2
0
        /// <summary>
        /// Finds all cells that contain the provided search value.
        /// </summary>
        /// <param name="elementScope">The element scope to start search (usually a TableRow or Table).</param>
        /// <param name="searchValue">The search value to look for.</param>
        /// <returns>List of cells found that contain the provided search value.</returns>
        public static IEnumerable <SnapshotElementScope> FindCells(this ElementScope elementScope, string searchValue)
        {
            var cells = elementScope.FindAllCells();

            return(cells.Where(c => c.HasContent(searchValue)));
        }