I'm using Selenium to fill in a web form. The fields there have their default values, usually it's 0
. If I issue the command
Driver.chrome.FindElement(By.Id("ID_of_my_element")).Clear();
the value changes from 0
to NaN
. The following input
Driver.chrome.FindElement(By.Id("ID_of_my_element")).SendKeys("12345");
results in NaN12345
. The desired result should be 12345
.
This the HTML of the said field:
<input class="form-control two-decimals text-box single-line"
data-val="true" data-val-number="The field myField must be a number."
data-val-required="The myField field is required." id="myId"
name="myName" style="max-width:100%; width:500px;" type="text" value="0.00">
Is there a way for me to fill these fields since my usual .Clear()
and then SendKeys()
route isn't giving me the expected result.