Reputation: 23
I have a text box and some data gets pre-filled in that text-box.How to verify what text inside that text box.
HTML Code :-
<div id="blkinner_first_name_readonly" class="bhTextFieldWrapper">
<label class="blk_lbl" for="id_first_name_readonly">Your First Name</label>
<input id="id_first_name_readonly" class="bhTextField" type="text" disabled="disabled" value="" name="first_name_readonly">
</div>
</div>
Upvotes: 2
Views: 1600
Reputation: 16201
Since you have not mentioned which binding you are using, I assume it's Java. If so the following should do the work
WebElement element = driver.findElement(By.id("id_first_name_readonly"));
//Find the attribute value which stores the value of auto field name
String name = element.getAttribute("value");
Upvotes: 1