1How many types of xpath are there?
2 - Two types of xpath
3-> What are the two types?
4 - Absolute and Relative xpath
5 #1- Absolute xpath:
6 - starts with /
7 - Starts from the very beginning of the html page,
8 and goes down to desired web element 1 by 1.
9 - it is NOT dependable at all.
10 - easly brakes if there is any minimal changes
11 in the structure of the HTML page.
12 #2- Relative xpath:
13 - starts with //
14 - // means you can start from anywhere in the HTML code
15 - it will jump to the first matching value and return it
16 - There are MANY different options to use relative xpath
17 Commmon xpaths:
18 #1- //tagName[@attribute='value']
19 #2- //*[@attribute='value'] --> * means look for all web elements
20 #3- //tagName[.='text'] --> returns the web element with given text.
21 -> instead of giving tag name if you pass * it return all the web elements
22 that contain given attribute and value regardless of the tag name.