Himanshu Varshney Himanshu Varshney - 4 months ago 35x
Java Question

getText() returning blank

<div class="header"> Account</div>
<div class="header"> Email</div>
<div class="value ng-binding">$50</div>==$0

Above is the HTML snippet, i am trying to fetch text: $50, with getText().To locate the element i have used className and xpath.

The problem that i am facing is that, Selenium is able to locate the element but return blank,in place of $50.


You should instead try using .getAttribute("innerHTML"); on the ClassName to return $50.