I am not sure what you mean by saying "cascading element". Are you looking for <a/>
element contained in element with class="lineItem"
which is contained in element with class="title"
? If so, there is at least two things you could do, to find that element:
Use Find.ByExistenceOfRelatedElement<T>(ElementSelector<T> selector)
ie.Link(
Find.ByExistenceOfRelatedElement<Element>(link => link.Ancestor(
Find.ByClass("title")
&& Find.ByExistenceOfRelatedElement<Element>(linksAncestor => linksAncestor.Ancestor(
Find.ByClass("lineItem"))))));
Use Predicate<Link>
ie.Link(link =>
{
var ancestor = link.Ancestor(Find.ByClass("title"));
return ancestor != null && ancestor.Ancestor(Find.ByClass("lineItem")) != null;
});
I bet there is another way.