I have a curious case where the selenium chrome driver getText() method (java) returns an empty string for some elements, even though it returns a non-empty str
getText()
Worked for me:
add as a predicate of xpath the length of string greater than 0:
String text = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//span[string-length(text()) > 0]"))).getText();