0

enter image description here

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

Update:

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')] 
1

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')]
0

Hope this work for you-

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