question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.getText fails on <span> element

See original GitHub issue

it seems that it is impossible to get a text of <span class="test">some text here</span> element. It works fine on <p> element for example.

Does anyone else has the same issue? Am I missing something?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
danieldramcommented, Nov 9, 2017

This still is present in the latest release. I have the same issue.

2reactions
EduardoMontanhacommented, Jan 6, 2017

This issue is happening to me now. I’m unable to get the text inside span elements. result.value returns as an empty string.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot get the text of a span element using .getText() on a ...
due to some weird reason it fails to work! var EC = protractor.ExpectedConditions; var tab = element(by.css("span.active-tab-head")); browser.
Read more >
How to get text from an element , when getText fails
So in most cases, if getText doesn't work use .getAttribute('textContent') Use: element(by.css("span[aria-label='Picker ID, TESTUSER']")).
Read more >
Selenium getText() from span - Google Groups
System.out.println("nameElement TEXT : " + nameElement.getText());. I have changed the xpath little bit. I have discarded div at starting in your xpath.
Read more >
getText - WebdriverIO
getText. Get the text content from a DOM-element. Make sure the element you want to request the text ... <span style="display: none">I am...
Read more >
How to retrieve the value of a span attribute? - Katalon Studio
[WebUI] Get Text ... Description Get the visible (i.e. not hidden by CSS) inner text of the web element, including sub-elements, without any ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found