All these expressions select different nodes:
.//* [@ id = 'Passwd']
"." at the beginning means that the current processing starts from the current node. "*" Selects all node nodes that descend from this current node with @id -attribute-value equal to "Passwd".
What if we do not use a dot at the beginning, what does it mean?
You will then select all element nodes with an @id -attribute value equal to "Passwd" throughout the document.
Just add // * to XPath - this highlights --- various page elements
This will result in the selection of all element nodes in the entire document.
Mentioned below: XPatht field for Gmail Password is true, what is the value *?
.//*[@id='Passwd']
This will allow you to select all nodes of nodes descending from the current node, the value of @id -attribute-value is equal to 'Passwd'.
// child :: login [@ type = 'password']
This will allow you to select all children named input , which @type type-attribute-values ββare equal to "password". The axis prefix of child:: may be omitted since this is the default behavior.
The syntax for selecting the appropriate expression is explained here at w3school.com .
And the axes (current point in processing) are explained here on another w3school.com page .
zx485 source share