ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is the difference between Absolute path & Relative path?

user-image
تم إضافة السؤال من قبل Anilkumar Bonchervu
تاريخ النشر: 2015/02/09
مستخدم محذوف‎
من قبل مستخدم محذوف‎

Absolute path uses complete path from root element to the desired element.

Relative path start by referencing the element we want and go from there till desired element.

 

Pakki Satish Patnaik
من قبل Pakki Satish Patnaik , Value Banker(senior officer) , Icici bank

A Relative URL is a the path to a file relative to the current location. If the file is in the same location as you are in you can just write it’s file name – extension included.

An Absolute URL is a full path to the file. It can be accessed from anywhere on the web, from any site as it provides the full address

Mohd Shoeb
من قبل Mohd Shoeb , Test Engineer , Motorola Solutions India Pvt Ltd

Absolute XPath Absolute XPath starts with the root node or a forward slash (/).

Advantage:

identifies the element very fast.

Disadvantage:

Some other tag added in between Absolute path will no longer works.

 

Example:1. html/head/body/table/tbody/tr/th

 

Relative Xpath: A relative XPath is one where the path starts from the node of your choice - it doesn't need to start from the root node.

It starts with Double forward slash(//)

Syntax: //table/tbody/tr/th

Advantage:

 

Don't need to mention the long xpath.

Ajay Gupta
من قبل Ajay Gupta , Associate Software Engineer , IBM

Absolute path is the full directory path from the root folder.For Ex: in Windows -> C:\\ABC\\test.xlsIn Linux -> //var/test.xlsRelative path is the relative to the present directory you are present in.For Ex: In windows: ..\\folder\\test.xlsIn Linux: ../test.xls We generally use relative path as it defines the path from current directoryAbsolute path we are not providing because its from root. so might be possibility that the folder which exists in my machine is not exists in other machines.

المزيد من الأسئلة المماثلة