This is a migrated thread and some comments may be shown as answers.

Issue with AddHierarchyConstraits of HtmlFindExpression

2 Answers 122 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vinay
Top achievements
Rank 1
Vinay asked on 02 Jun 2015, 01:03 PM

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));

oldExpr .AppendChain(expr);

 

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.

2 Answers, 1 is accepted

Sort by
0
Vinay
Top achievements
Rank 1
answered on 03 Jun 2015, 03:37 PM
Anyone there for help?
0
Ivaylo
Telerik team
answered on 05 Jun 2015, 07:38 AM
Hello,

You can use this article as a starting point.


Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Vinay
Top achievements
Rank 1
Answers by
Vinay
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or