Class BasicPath.ChildNumber

  • Enclosing class:
    BasicPath

    public static final class BasicPath.ChildNumber
    extends Object
    Allows to define an element that has a predefined number of similar preceding siblings. Count starts at 1 (same as you would use in English). Should be used through the method BasicPath.childNumber(Integer) . Example:
         childNumber(5).ofType(div); 
     
    • Constructor Detail

      • ChildNumber

        public ChildNumber​(Integer n)
        Does not return any usable Path by itself. Must be used like: ChildNumber(5).ofType(div)
        Parameters:
        n - the number of child. Count starts at 1.
    • Method Detail

      • ofType

        public Path ofType​(Path path)
        an element that has n similar preceding siblings. For example: ChildNumber(5).ofType(element.withText("john")) will correspond to the fifth child that has text "john"
        Parameters:
        path - the element to find
        Returns:
        a new Path instance