I have a span tag like this:
<div class="row-flex">
<span class="icon-arrow-down-outline rotate-v"></span>
<span class="bmi-value ng-binding">22</span>
</div>
I want to get the value 22 of this span tag, so I write java code like this:
WebElement spanValue = webDriver.findElement(By.xpath("//span[@class='bmi-value ng-binding']"));
String value = spanValue.getText();
but it always returns an empty string. What is missing?