Reputation: 11
In my design code, the following is written. I cannot understand what xpath="1"
means here.
<select class="search-category" id="ddlTemp" name="Template" xpath="1">
<option value="">Select</option>
<option value="a">a</option>
<option value="b">b</option>
</select>
Upvotes: 1
Views: 1659
Reputation:
XPath='1' is not the part of your HTML, it is being added through chropath plugin. You have copied this html with opened chropath tab. If you refresh the page and close the chropath tab, then you will not find xpath=1.
Upvotes: 0
Reputation: 111726
There is no standard interpretation of xpath="1"
in HTML because there is no standard xpath
attribute on a select
element (or any other HTML element). You've stumbled across some application's idiosyncratic markup; you'll have to consult the application's authors, documentation, or source code to learn the semantics of xpath="1"
.
Note further that the proper way to add an application or user specific attribute would have been to name it with a data-
prefix: data-xpath
.
There is an XPath utility, ChroPath, that runs as a browser extension and writes xpath
(and css
) attributes on elements. Credit: Randy Casburn answer to What is the significance of the attribute xpath="1" while constructing locators for Selenium tests
Upvotes: 2