/// <summary> /// Gets the constraint expressed by this attribute. /// </summary> /// <returns>The constraint</returns> protected virtual Constraint GetConstraint() { Constraint constraint = null; Combine(ref constraint, CreateStringConstraint(Find.ByAlt, Alt)); Combine(ref constraint, CreateRegexConstraint(Find.ByAlt, AltRegex)); Combine(ref constraint, CreateStringConstraint(Find.ByClass, Class)); Combine(ref constraint, CreateRegexConstraint(Find.ByClass, ClassRegex)); Combine(ref constraint, CreateStringConstraint(Find.ByFor, For)); Combine(ref constraint, CreateRegexConstraint(Find.ByFor, ForRegex)); Combine(ref constraint, CreateStringConstraint(Find.ById, Id)); Combine(ref constraint, CreateRegexConstraint(Find.ById, IdRegex)); Combine(ref constraint, CreateStringConstraint(Find.ByName, Name)); Combine(ref constraint, CreateRegexConstraint(Find.ByName, NameRegex)); Combine(ref constraint, CreateStringConstraint(Find.BySrc, Src)); Combine(ref constraint, CreateRegexConstraint(Find.BySrc, SrcRegex)); Combine(ref constraint, CreateStringConstraint(Find.ByText, Text)); Combine(ref constraint, CreateRegexConstraint(Find.ByText, TextRegex)); Combine(ref constraint, CreateStringConstraint(Find.ByTitle, Title)); Combine(ref constraint, CreateRegexConstraint(Find.ByTitle, TitleRegex)); Combine(ref constraint, CreateStringConstraint(Find.ByUrl, Url)); Combine(ref constraint, CreateRegexConstraint(Find.ByUrl, UrlRegex)); Combine(ref constraint, CreateStringConstraint(Find.ByValue, Value)); Combine(ref constraint, CreateRegexConstraint(Find.ByValue, ValueRegex)); if (Index != -1) { Combine(ref constraint, Find.ByIndex(Index)); } return(constraint ?? Find.Any); }
/// <summary> /// Finds te first row that matches <paramref name="predicate"/> in <paramref name="inColumn"/> /// defined as a TD html element. If no match is found, <c>null</c> is returned. This method will look for rows in all /// <see cref="Core.TableBody"/> elements but will ignore rows in nested tables. /// </summary> /// <param name="predicate">The predicate that the cell text must match.</param> /// <param name="inColumn">Index of the column to find the text in.</param> /// <returns>The searched for <see cref="TableRow"/>; otherwise <c>null</c>.</returns> public virtual TableRow FindRowInOwnTableRows(Predicate <TableCell> predicate, int inColumn) { return(FindInOwnTableRows(Find.ByExistenceOfRelatedElement <TableRow>(row => row.OwnTableCell(Find.ByIndex(inColumn) & Find.ByElement(predicate))))); }
public virtual TableCell TableCell(Regex elementId, int index) { return(TableCell(Find.ById(elementId) & Find.ByIndex(index))); }
public virtual TableCell TableCell(string elementId, int index) { return(TableCell(Find.ById(elementId) & Find.ByIndex(index) & Find.Any)); }
public static TableCell TableCell(DomContainer domContainer, Regex elementId, int index, IElementCollection elements) { return(new TableCell(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.TableCell.ElementTags, Find.ByIndex(index).And(Find.ById(elementId)), elements))); }
public TableCell TableCell(string elementId, int index) { return(TableCell(Find.ById(elementId) & Find.ByIndex(index))); }