Mobile QA Zone

A Mobile Application Testing Community

When should I use “/” and “//” in Xpath  while automating a web product ?

Views: 18

Reply to This

Replies to This Discussion

Hi,


  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
/start/next/last
- 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.

RSS

© 2018   Created by Anurag Khode.   Powered by

Badges  |  Report an Issue  |  Terms of Service

Welcome to Mobile QA Zone, a Next Generation Software Testing Community.Invite your friends to join this community.Write to us to become a featured member.