Home > Back-end >  How to get data from a disable dynamic field in C#?
How to get data from a disable dynamic field in C#?

Time:10-08

My html is as such

 <input type="textbox" id="TlNo" class="TlNo" style="display:block;" value="" disabled="">

The field is as follows

enter image description here

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;
  • Related