Himanshu Varshney Himanshu Varshney - 1 year ago 177
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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download