Gourav Shivalkar
Gourav Shivalkar

Reputation: 83

Dynamic xpath in selenium webdriver

Can anybody please tell me what is the difference between // and //* in xpath. Is there any difference?

Upvotes: 0

Views: 444

Answers (3)

Ssik
Ssik

Reputation: 96

//div[@id='xyz'] means find all div-s with the mentioned if ,// means that it is an relative Xpath and not an absolute one.

//*[@id='xyz'] find all element with the mentioned id not just div.Again it is an Relative Xpath as it starts with //

Upvotes: 0

Leon Barkan
Leon Barkan

Reputation: 2703

"//div[@id='something']" - will find the div with id something.

"//*[@id='something']" - will find any tag with id something.

Upvotes: 2

ratr
ratr

Reputation: 616

Source-Xpath Syntax

//* Selects all elements in the document

// Selects nodes in the document from the current node that match the selection no matter where they are

Upvotes: 0

Related Questions