![]() ![]() ![]() Selenium Locators – preceding-sibling XPath AXESįollow the below steps to practice preceding-sibling XPath Axes along with me:ġ) Open in Chrome Browser, where ChroPath is already installed (Refer ChroPath installation in Chrome Browser here and its usage in Chrome Browser here ) as shown below:Ģ) Open ChroPath in Chrome Browser where ‘Rel XPath’ is selected as shown below:ģ) Let’s first locate the ‘body’ tag in this page using the Relative XPath Expression //bodyĮxecute the above XPath Expression in ChroPath and observe that the ‘body’ tag on the page got located as shown below:’Ĥ) Now using the above Relative XPath Expression and preceding-sibling XPath Axes, let’s create the below Relative XPath expression to locate the ‘head’ sibling tag that comes before the ‘body’ tag.Įxecute the above XPath Expression in ChroPath and observe that it is locating the head tag on the page as shown below:ĥ) Now let’s locate the sibling ‘p’ tag in this page that comes before the second ‘p’ tag in the page. Let’s get started with the practical demonstration of preceding-sibling XPath Axes. Hence all the brother and sister tags that come before the current tag will be located using preceding-sibling XPath Axes. ![]() tags at the same level or children of the same parent) Siblings in the above statements mean brother and sister level tags (i.e. Preceding-sibling XPath Axes select/traverse all the sibling tags in the HTML document that comes before the current tag. ![]() In this article, I am going to explain the next XPath Axes i.e. In the previous articles, I have listed the different types of XPath Axes available and explained the following, preceding and following-sibling XPath Axes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |