I am trying to locate a Button with a span text. I already tried it with the class but the class is used 6 times.
HTML:
<a href="#" class="btn-orange btn-border" ng-click="selectWorld(w.id)"> <span class="text world ng-binding">Krak des Chevaliers</span> </a>
C#:
driver.FindElement(By.XPath("(//a[span/text()='Krak des Chevaliers'])")).Click();
It can't find the Object. Please help :)
span
first and then get back to its parent element like this://a/span[text()='Krak des Chevaliers']/..
//*[text()='Krak des Chevaliers']/..
?