FindExpression does not support expressions which query the DOM hierarchy?

8 posts, 0 answers
  1. Vince
    Vince avatar
    16 posts
    Member since:
    Mar 2013

    Posted 06 Aug 2013 Link to this post

    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:

    HtmlFindExpression expression = new HtmlFindExpression("tagindex=td:3");
    IList<Element> foundelements = tablecontrol.Find.AllByExpression(expression);
    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.
  2. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 09 Aug 2013 Link to this post

    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
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Vince
    Vince avatar
    16 posts
    Member since:
    Mar 2013

    Posted 09 Aug 2013 Link to this post

    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.
  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 12 Aug 2013 Link to this post

    Hello Vince,

    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,
    Cody
    Telerik
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  5. Vince
    Vince avatar
    16 posts
    Member since:
    Mar 2013

    Posted 13 Aug 2013 Link to this post

    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.

  6. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 13 Aug 2013 Link to this post

    Hello Vince,

    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.

    Regards,
    Cody
    Telerik
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  7. Michael
    Michael avatar
    3 posts
    Member since:
    Jun 2018

    Posted 14 Jun in reply to Cody Link to this post

    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. 
  8. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    971 posts

    Posted 18 Jun Link to this post

    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
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top