A Mobile Application Testing Community
Web application testing services uses Xpath in web automation testing for locating elements in DOM.
It is an embedded language which always used within another programming language that can process XML nodes. The basic difference between '/' and '//' is as:
- '/' selects from the root node
- '//' selects nodes in the document from the current node that match the selection
- If '/' is used on its own with no other names or steps, it refers to the XML document itself.
- If '/' is the first symbol of the expression, it is telling the XPath processor to start the search at the top-most element
- if '//' is the first symbol of an expression, then it search the entire XML document
- if '//' separates steps in an expression, it means search all descendants from the last step.