Notes: Selenium XPath Tutorial #10 - XPath Axes `following` and `following-sibling` 1. Introduction: - These methods select nodes appearing after the context node in the HTML DOM. 2. `following` Method: - `following` selects nodes appearing after the context node in the DOM. - XPath format: `//tagname[@attribute='value']//following::tagname`. - All nodes after the current node are selected. 3. `following-sibling` Method: - `following-sibling` selects nodes with the same parent as the context node. - Nodes should appear after the context node. - XPath format: `//tagname[@attribute='value']//following-sibling::tagname`. 4. Example Using Chrome Developer Tools: - Inspect dropdown element to demonstrate `following` and `following-sibling` methods. 5. Example Scenario: - Select `option` element with value `AG` and find all `option` elements that appear after it. 6. XPath Examples: - For `following`: `//option[@value='AG']//following::option`. - For `following-sibling`: `//option[@value='AG']//following-sibling::option`. 7. Benefits and Usage: - `following` and `following-sibling` are useful when web elements lack unique attributes. - Understanding their appropriate usage enhances web element locating strategies in Selenium automation.
Hi Dilawar, Please find complete playlist here: "ua-cam.com/video/5LV4z_-91WY/v-deo.html" Please follow the tutorials in order so you do not miss any parts. Regards,Manish
descendant selects elements which are on the level below the current node, like children, grandchildren etc... Following on the other way selects elements that are on the same level, but appear next to each other.
Hi Dilawar, Please find complete playlist here: "ua-cam.com/video/5LV4z_-91WY/v-deo.html" Please follow the tutorials in order so you do not miss any parts. Regards,Manish
Notes: Selenium XPath Tutorial #10 - XPath Axes `following` and `following-sibling`
1. Introduction:
- These methods select nodes appearing after the context node in the HTML DOM.
2. `following` Method:
- `following` selects nodes appearing after the context node in the DOM.
- XPath format: `//tagname[@attribute='value']//following::tagname`.
- All nodes after the current node are selected.
3. `following-sibling` Method:
- `following-sibling` selects nodes with the same parent as the context node.
- Nodes should appear after the context node.
- XPath format: `//tagname[@attribute='value']//following-sibling::tagname`.
4. Example Using Chrome Developer Tools:
- Inspect dropdown element to demonstrate `following` and `following-sibling` methods.
5. Example Scenario:
- Select `option` element with value `AG` and find all `option` elements that appear after it.
6. XPath Examples:
- For `following`: `//option[@value='AG']//following::option`.
- For `following-sibling`: `//option[@value='AG']//following-sibling::option`.
7. Benefits and Usage:
- `following` and `following-sibling` are useful when web elements lack unique attributes.
- Understanding their appropriate usage enhances web element locating strategies in Selenium automation.
thank you so much
Thank you sir
What is the difference between following and descendant ?
great content as usual sir, did you discuss frames in any video?if yes kindly share link
Hi Dilawar, Please find complete playlist here: "ua-cam.com/video/5LV4z_-91WY/v-deo.html"
Please follow the tutorials in order so you do not miss any parts. Regards,Manish
getting confused what is the difference between descendant and following xpath, both looks same. please let me know the answer asap.
descendant selects elements which are on the level below the current node, like children, grandchildren etc... Following on the other way selects elements that are on the same level, but appear next to each other.
the site is not working for inspecting
sir you did not implemented the past 4 lectures, too much confusing this and the last 4 lectures.
Hi Dilawar, Please find complete playlist here:
"ua-cam.com/video/5LV4z_-91WY/v-deo.html"
Please follow the tutorials in order so you do not miss any parts. Regards,Manish
screen got blurred after 5.30min
Hi Rajshri, it’s not blurred just colour overlay is done by purpose to highlight the final xpath. Regards, Manish