XPATH Rules 1
XPATH Rules 1
/html/body/p[@id]
/html/body/p[@*]
/html vs //html
//* vs //*[@*] as html tag also have some attributes
Asterisk * or wild cards used to represent any tag and any attributes
Node () used to represent only any tags
1. Asterisk is the most used wild cards in X- Path and node () is least used
2. Asterisk represents any tags and any attributes. But node() represent only any tag
3. Node () can be replaced with asterisk.
4. At the end of X-Path expression you cannot used the node() like this, /html/body/node()
5. Don’t used node () in real time as needs least time.
//table/tbody/tr
//table//tr direct/shortcut
Text() does not support attribute values where contains() and start-with() supports