I am trying to retrieve a value from an input field with Selenium in Java. Here is the relevant HTML code:
<input class="form-control input-sm " id="NameInputID" type="text" maxlength="16" name="NameInput" value="TheValueWanted" readonly="">
I have tried:
driver.findElement(By.id("NameInputID")).getText();
and
driver.findElement(By.id("NameInputID")).getAttribute("value");
None of them returned with the value(blank text). How should i deal with this?
Thanks!