My html is as such
<input type="textbox" id="TlNo" class="TlNo" style="display:block;" value="" disabled="">
The field is as follows
How can I get the value of this disable textbox?
Please note the value of this textbox will keep changing based on calculations.
CodePudding user response:
I was able to get the value by adding the following getAttribute("value")
var element = driver.FindElement(By.Id("TlNo")).GetAttribute("value");
CodePudding user response:
Can you please try this one,
var element = driver.FindElement(By.Id("TlNo")).Text;