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

Element and Xpath

1 Answer 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Prateek
Top achievements
Rank 1
Prateek asked on 15 Jun 2010, 09:23 AM
The Browser has FindElementByXPath() method.
But seems like for this to work one would need to give the Xpath from the root layer.

Is there a way to query for child nodes using an xpath ? So that we can give an xpath relative to the current node and not from root ?

Didnt look like the Element class supported querying for subtree using xpath, Is there a workaround ?

Many Thanks!
Prateek

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 17 Jun 2010, 11:43 PM
Hello Prateek,

For any HtmlControl, you can do a sub find. So something like HtmlControl.Find.ByXPath<>();

Instead of using Element, you can use the same finds to return at least an HtmlControl or a more strongly typed Html Wrapper Class for the tag, like HtmlDiv Wrapper Class for a div.

You can then do a sub find using an XPath as explained above.

Kind regards,
Nelson Sin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Prateek
Top achievements
Rank 1
Answers by
Missing User
Share this question
or