Xpath //* Vs //element Vs //
I have a confusion in finding XPath: When to put //* at start and when to put just // will work. For example, I was trying to clear this thing on https://www.myntra.com/. There is
Solution 1:
//*[@class='desktop-searchBar']
says to select all elements, regardless of name, with an
class
attribute value ofdesktop-searchBar
.//input[@class='desktop-searchBar']
says the same as #1 except constrains the element to be named
input
.//[@class='desktop-searchBar']
is syntactically invalid in XPath because it's missing a required node test such as
input
(element namedinput
) or*
(any element).
Post a Comment for "Xpath //* Vs //element Vs //"