[Solved] What is the significance of the attribute xpath=”1″ while constructing locators for Selenium tests


That attribute (xpath=”1″) is placed there by a browser extension named CHROPATH. It is provided by a feature they call Dynamic Attribute Support.

Scolling down the page one will find a text description of how to use the tool.

Scroll to Note: at the bottom of the page, or search for “Note:” within the page text. Take special attention to note #2. The entire note reads:

Note:

  1. For one selector only, change the dropdown value from selectors to rel XPath/abs Xpath/CSS sel in header.
  2. Tool will add xpath/css attribute to all the matching node(s) as per their sequential occurrence. For example, a matching node
    appearing second in the list will have xpath=2. And if verifying CSS
    then it will add css=2.
  3. Supports only those iframe which are from the same src.

3

solved What is the significance of the attribute xpath=”1″ while constructing locators for Selenium tests