I am trying to locate a number of elements which are structurally related to a known element in the hierarchy; in this case, finding all the td cells in a single column of a table. I am trying to use a FindExpression as recommended in the user guide, but it is failing with an error
InnerException:
System.NotSupportedException: Find.All is currently not supported for expressions that have a hierarchal dependency
My code works like this:
Note that the expression I am using is very similar to one of the expressions in the user guide (""tagindex=td:0"").
The code compiles without problems, but at runtime it throws the exception as above. What do I need to do to use a find expression to locate the td elements in this way?
P.S. See attachments for a simple worked example.
InnerException:
System.NotSupportedException: Find.All is currently not supported for expressions that have a hierarchal dependency
My code works like this:
HtmlFindExpression expression =
new
HtmlFindExpression(
"tagindex=td:3"
);
IList<Element> foundelements = tablecontrol.Find.AllByExpression(expression);
The code compiles without problems, but at runtime it throws the exception as above. What do I need to do to use a find expression to locate the td elements in this way?
P.S. See attachments for a simple worked example.
7 Answers, 1 is accepted
0
Hi Vince,
Thank you for the project and your notes.
I've went ahead and logged this as a feature request. You can track in our Feedback Portal its progress here: Public URL.
We appreciate your feedback, which we rely on to improve our product.
Regards,
Velin Koychev
Telerik
Thank you for the project and your notes.
I've went ahead and logged this as a feature request. You can track in our Feedback Portal its progress here: Public URL.
We appreciate your feedback, which we rely on to improve our product.
Regards,
Velin Koychev
Telerik
0
Vince
Top achievements
Rank 1
answered on 09 Aug 2013, 02:20 PM
Well, thank you for logging it as a feature request; however, I don't think that's the right category. The documentation for FindExpression describes this as current behaviour, so shouldn't it be categorised as a fault? I'm not asking for something new, I'm asking for the advertised functionality to work.
0
Hello Vince,
Cody
Telerik
I am the manager of Test Studio technical support. I apologize for the apparent confusion in our documentation. Our current design implementation of the FindAllByExpression cannot support any type of hierarchical expressions including:
- Tag index path expressions
- HTML path expressions
- XPath expressions
The code is designed to perform an iterative search for all HTML DOM elements that match a specific set of properites e.g. id=x and src=y, etc. It is not possible to do an iterative search when you pass in any form of a hierarchical expression.
If this is what you really need to do, I recommend you use the Find.AllByXPath() function instead. We have many other Find.AllByxxxx methods for you to choose from:
http://www.telerik.com/automated-testing-tools/support/documentation/online-api-reference/html/Methods_T_ArtOfTest_WebAii_Core_Find.htm
Regards,If this is what you really need to do, I recommend you use the Find.AllByXPath() function instead. We have many other Find.AllByxxxx methods for you to choose from:
http://www.telerik.com/automated-testing-tools/support/documentation/online-api-reference/html/Methods_T_ArtOfTest_WebAii_Core_Find.htm
Cody
Telerik
0
Vince
Top achievements
Rank 1
answered on 13 Aug 2013, 07:58 AM
Thank you Cody; I will try the other Find.AllByxxxx methods to see if there is one which precisely covers my requirements; however in the meantime, I suggest you amend your documentation to accurately reflect what the FindAllByExpression method can and cannot do.
0
Hello Vince,
Cody
Telerik
Thank you for your feedback, which we always use to improve our product. I've passed this along to our documentation team for them to figure out the best way to adjust this part of the documentation.
Cody
Telerik
0
Michael
Top achievements
Rank 1
answered on 14 Jun 2018, 01:41 PM
It's giving me that error and I used that Find.AllByXPath method, both with the xpath containing the parent element, and by chaining the method on the parent element.
0
Hi Mark,
Thank you for your query.
Though I have to admit you are addressing a discussion which dates back almost five years ago. Test Studio has evolved during that time and the current issue you are facing might be irrelevant to this conversation.
Therefore I would like to kindly ask you to share further details of what the current scenario's requirements are. In addition I would like to share with you the Find methods you could use to locate elements using Test Studio.
In case there is anything else I could be helpful with, please let me know!
Regards,
Elena Tsvetkova
Progress Telerik
Thank you for your query.
Though I have to admit you are addressing a discussion which dates back almost five years ago. Test Studio has evolved during that time and the current issue you are facing might be irrelevant to this conversation.
Therefore I would like to kindly ask you to share further details of what the current scenario's requirements are. In addition I would like to share with you the Find methods you could use to locate elements using Test Studio.
In case there is anything else I could be helpful with, please let me know!
Regards,
Elena Tsvetkova
Progress Telerik