Basic Xpath – XPath expression select nodes or list of nodes on the basis of attributes like ID , Name, Classname, etc. from the XML document.
Contains() – Contains() is a method used in XPath expression. It is used when the value of any attribute changes dynamically.
Using OR & AND – In OR expression, two conditions are used, whether 1st condition OR 2nd condition should be true. It is also applicable if any one condition is true or maybe both. Means any one condition should be true to find the element.
Starts-with() – It is used to identify an element, when we are familiar with the attributes value (starting with the specified text) of an element
Text() – This mechanism is used to locate an element based on the text available on a webpage.
Following – By using this we could select everything on the web page after the closing tag of the current node.
Ancestor – The ancestor axis selects all ancestors element (grandparent, parent, etc.) of the current node.
Child – Selects all children elements of the current node.
Preceding – Selects all nodes that appear before the current node in the document, except ancestors, attribute nodes and namespace nodes.
Following-sibling – Select the following siblings of the context node. Siblings are at the same level of the current node.
Parent – Selects the parent of the current node.
position() – Selects the element out of all input element present depending on the position number provided
What are the common expression is associated with Xpath?
Category:
Selenium WebDriver