Selenium XPath Tutorial #2 - Relative Vs Absolute XPath

preview_player
Показать описание
In this Selenium XPath tutorial we will learn about relative vs absolute XPath with examples. We will first understand about relative and absolute XPath and then analyse which one to prefer over other.

Finally, you will learn how to create absolute and relative XPath for any webelement in your web application.

Help me in spreading the knowledge, please hit LIKE, SHARE and SUBSCRIBE for latest tutorials. More tutorial playlists below:

🔶 ENROL IN MANY FREE TRAININGS ON RCV ACADEMY PORTAL 🔶

🔶 FOLLOW US ON TWITTER 🔶

🔶 LIKE US ON FACEBOOK 🔶

🔶 OUR TUTORIAL WEBSITES 🔶

🔶 GET MY TRAININGS ON UDEMY 🔶
#XPathTutorial #XPath #SeleniumXPath #SeleniumTutorial #TestAutomation #SoftwareTesting #RcvAcademy #SoftwareTestingMentor
Рекомендации по теме
Комментарии
Автор

Very beautifully explained sir❤u cleared all my confusions on Xpath🙌
Am very happy after watching this session ❤😍

vijaykumarthimblikv
Автор

Hello Sir, Thanks for such wonderful videos! I am enjoying my learning with the help of your videos. Keep posting!

radhikaagarwal
Автор

**Understanding Absolute and Relative XPath in Selenium - Notes:**

- Introduction:
- Absolute XPath contains the complete path from the root element to the desired web element.
- Relative XPath starts from the middle of the HTML DOM structure.

- Absolute XPath:
- Starts with a single forward slash, like "/HTML/body/nav/a[2]".
- Prone to failure if there are HTML DOM structural changes.
- Not recommended for robust automation.

- Relative XPath:
- More resilient to HTML DOM structural changes.
- Recommended for stable and reliable automation.

- Absolute XPath Example:
- Absolute XPath for a specific div element: "/html/body/div[2]/div[3]".

- Relative XPath Example:

- Advantages of Relative XPath:
- Less prone to breaking with HTML DOM structural changes.
- Offers stability and reliability to automation scripts.

- Conclusion:
- Absolute XPath contains the complete path from the root node, but it's not recommended for robust automation.
- Relative XPath starts closer to the desired element, making it more adaptable to changes.
- For stable and reliable automation, it's advisable to use relative XPath.

manoj_mafiosi
Автор

Hello Sir, thankyou for the amazing video. Can we determine xpath in Internet Explorer as well using CTRL+F ?

ayushirajvanshi
Автор

Hello sir I have one question
Where we are using absolute x path???

manjushanetragaonkar
Автор

so why use absolute xpath when its better to use relative?

Itech
Автор

// getting elements under shadow root
WebElement id_field=



rishikeshshah