Selenium Element Search by XPath | Selenium Tutorial For Beginners Part#5

preview_player
Показать описание
Hello Friends,
In this tutorial, we will learn to find elements by using XPath locators. I have explained the easy way to write error-free XPath with chrome. Please watch the complete tutorial for a better understanding of base concepts.

7) By Xpath

What is xpath?******************************************************************************
XPath contains the path of the element located on the web page. Standard XPath syntax for creating XPath is :

// : Select current node.
Tagname: Tagname of the particular node.
@: Select attribute.
Attribute: Attribute the name of the node.
Value: Value of the attribute.

Types of X-path
There are two types of XPath:

1) Absolute XPath
2) Relative XPath

7) by Xpath

What is xpath?*****************************************************************************
XPath contains the path of the element located on the web page. Standard XPath syntax for creating XPath is.

// : Select current node.
Tagname: Tagname of the particular node.
@: Select attribute.
Attribute: Attribute the name of the node.
Value: Value of the attribute.

Types of X-path
There are two types of XPath:

1) Absolute XPath

2) Relative XPath

Easy way to write Xpath in selenium:
*************************************
(absoulute path)
/html/body/div[4]/div[2]/div[2]/div[2]/div[1]/div[2]/div[2]/div[2]/div/div/ul/li[5]/a

better to use a Relative path

If you found this video tutorial useful and would like to support me, you can do so by buying me a coffee using the below link!
Рекомендации по теме