I am trying to get the xpath of the highlighted element(span) in the below image.
I tried the below options and none of them are working:
//span[contains(text(),'Database')]
//span[ends-with(., 'Database')]
//span[text()='\u00A0\u00A0Database']
//span[contains(., '\u00A0\u00A0Database')]
Given the HTML:
The desired text Database
is within the <span>
.
To locate the element you can use either of the following locator strategies:
Using XPATH and the text Database`:
//span[contains(., 'Database')]
Using XPATH and the text Database
:
//span[contains(., '\u00A0Database')]
You can find a couple of relevant detailed discussion in: