Completed
Last Updated: 03 Jul 2018 14:09 by Vince
ADMIN
Velin Koychev
Created on: 09 Aug 2013 07:10
Type: Feature Request
1
Find.All to support expressions that have a hierarchal dependency
If you try to locate a number of elements which are structurally related to a known element in the hierarchy and use the following code:
HtmlControl tablecontrol = Manager.ActiveBrowser.Find.ByXPath<HtmlControl>("//table[@class='tTable tTableStripes']");
HtmlFindExpression expression = new HtmlFindExpression("tagindex=td");
IList<Element> foundelements = tablecontrol.Find.AllByExpression(expression);

The code compiles without problems, but at runtime it throws the exception:
InnerException:
System.NotSupportedException: Find.All is currently not supported for expressions that have a hierarchal dependency
3 comments
Vince
Posted on: 13 Aug 2013 07:57
Ah, I have seen your answer in the forums (http://www.telerik.com/automated-testing-tools/community/forums/test-studio/general-discussions/findexpression-does-not-support-expressions-which-query-the-dom-hierarchy.aspx#2744181); thank you.
Vince
Posted on: 13 Aug 2013 07:55
I can use Find.AllByXpath (subject to the limitations I've reported, http://www.telerik.com/automated-testing-tools/community/forums/test-studio/general-discussions/element-find-fails-when-using-relative-xpath.aspx#2740306), but I'm interested to know why FindAllByExpression doesn't work in this way, as recommended in the online user guide: http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/write-tests-in-code/intermediate-topics/element-identification/find-expressions.aspx
Cody
Posted on: 12 Aug 2013 21:08
Please use Find.AllByXPath instead. This method was designed to return multiple elements given an XPath expression. See: http://www.telerik.com/automated-testing-tools/support/documentation/online-api-reference/html/M_ArtOfTest_WebAii_Core_Find_AllByXPath.htm