.getText fails on <span> element
See original GitHub issueit 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:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This still is present in the latest release. I have the same issue.
This issue is happening to me now. I’m unable to get the text inside span elements. result.value returns as an empty string.