What Is The Difference Between Absolute XPath And Relative XPath In Selenium | Xpath Contains Class

Опубликовано: 05 Август 2026
на канале: Teach Yourself Test Automation
502
1

What Is The Difference Between Absolute XPath And Relative XPath In Selenium | Xpath Contains Class http://teachyourselftestautomation.com

Hello and welcome to Day 15 - What Is The Difference Between Absolute XPath And Relative XPath In Selenium

I'm encouraging you to come along this journey with me, learn to use an automation test tool It does not have to be selenium webdriver it could be UFT, Katalon Studio or any of the others of which there are many

Xpath is the path navigated or traverse along the HTML code from any chosen point to the desired HTML code for that web element or object

Relative Xpath you don't have to traverse from root node which is your HTML tag all the way down to your desired HTML code for that element

Select any point between the HTML root node and HTML for the desired web element and form and Xpath

With Relative Xpath it starts with a '//' double back slash meaning selection at any point along the entire HTML code

Absolute Xpath you have to traverse from root node which is your HTML tag all the way down to your desired HTML code for that element

With Absolute Xpath it starts with a '/' single back slash meaning selection at the base or root node of HTML code which is your HTML tag

There is a draw back in using absolute xpath because the xpath spans the entire HTML code body if the developers should
change any code this absolute xpath will break and not work

Please stick to customizing your own xpath, make it a habit or use the web browser to obtain or copy an xpath for desired
element

Don't forget to subscribe if you found this video helpful and support the channel

Many Thanks

Kevin Owasu Itoe

What Is The Difference Between Absolute XPath And Relative XPath In Selenium | Xpath Contains Class http://teachyourselftestautomation.com
--------------------------------------------------------------------------------------------------------
#testautomation #teachyourselftestautomation #selenium #webdriver #java
--------------------------------------------------------------------------------------------------------
Follow me @
Facebook:   / kevin.itoe.50  
Google+: https://plus.google.com/u/0/103559195...
Pinterest: https://www.pinterest.co.uk/owasuik/
My Blog: http://teachyourselftestautomation.com/
My YouTube Channel:    / @teachyourselftestautomatio1271  
--------------------------------------------------------------------------------------------------------
My Videos:
   • Install And Configure Java | Selenium Webd...  
   • Eclipse Installation | eclipse software | ...  
   • Java Project Template | Java Projects | My...  
   • Download And Configure Selenium | Selenium...  
   • Basic Selenium Test Script To Invoke Web B...  
   • Selenium Tutorial | WebDriver Browser And ...  
   • Selenium Webdriver Locators | Locators In ...  
   • Find Elements On Web Page With Link Text X...  
   • How To Validate Xpath And CSS Using Browse...  
   • How To Write Customized Xpath In Selenium ...  
   • CSS Selector | How To Write Custom CSS Sel...  
   • Preceding-Sibling Xpath | How To Identify ...  
   • What Is The Difference Between Absolute XP...  
-------------------------------------------------------------------------------------------------------
What Wikipedia says about selenium: https://en.wikipedia.org/wiki/Seleniu...)