i want to find an element based on its hierarchy. so i am using the AddHierarchyConstraint method of HtmlFindExpression as follows:
HtmlFindExpression oldExpr = new HtmlFindExpression("TagName=table" class ="xmlMenuCellSpacing");
HtmlFindExpression expr = new HtmlFindExpression("TagName=td");
expr.AddHierarchyConstraint(new HierarchyConstraint(new HtmlFindExpression("TagName=a", "TextContent="+item.ToClauseString()), 1));
But when i am appending the hierarchy constraints exprression to some old expression chain. The new expression lost the hierarchy constraint after AppendChain() call. I need a long chain of expression with hierarchy constraints .
Should it be a bug or you only allow hierarchy constraints in a single expression not in a chained expression.
I have attached the scenario i am working on . There i need to find a cell(td) which have <a> anchor tag with text content as "Layout" whose parent(grandparent or so on..) is a cell (td) which have <a> anchor tag with text content as "Window" which have a parent (grant parent or so on..) is a table (table) with class =xmlMenuCellSpacing.
Please let me know what are the possible way of achieving the above said scenario.