enter image description here

Facing issues while locating element outside the span please refer the images and post the xpath for it.


I have tried the suggestion in Upkar Singh's answer and the xpath below with no success. After <span></span> nothing is accessible.

.//*[contains(text(),'PAINEL DE CONTROLE EDITORA')] 

Looks like this is a situation where dot works and text() does not. I don't understand dot enough to know why at this point, but the answers on this question go into detail about it: https://stackoverflow.com/questions/38240763/xpath-difference-between-dot-and-text/38240971

//span[contains(., 'PAINEL DE CONTROLE EDITORA')]

Hope this work for you-

driver.findElement(By.xpath(".//span[@class='title'][contains(text(),'PAINEL DE CONTROLE EDITORA')]"));
  • this xpath is not working Apr 25 '19 at 10:57
  • add your stacktrace to your question. Apr 25 '19 at 11:00
  • Even .//*[contains(text(),'PAINEL DE CONTROLE EDITORA')] is not working Apr 25 '19 at 11:02
  • I understand some times it does not work, what is in your stacktrace can you please tell? Apr 25 '19 at 11:05
  • If this is not working then try to make Xpath from root element that will easily work. Apr 25 '19 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.