Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
172 views
by The go-to Tester (473 points)
edited by

Our application has many text fields. On UI, user can edit these text fields. But when i try to get text using getText() then its returning me blank fields. I checked in firebug, and in that i found text is not present in HTML source code. 

See the screen shot.

1 Answer

0 like 0 dislike
by
selected by
 
Best answer

To retrieve value from the text field, you should use 

ele.getAttribute("value");

Above code will return text present inside the text box as a string.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...